Home › Forums › WinForms controls › Xceed Grid for WinForms › How can i set the focus to an InsertionRow after the row insertion?
-
AuthorPosts
-
#17575 |
Hi:
I am insert data into the grid using InsertionRow. I would like set the focus in the first cell of the insertion row once i have inserted the last datarow.
Any suggest?
Thanks in advance.
Aure
Imported from legacy forums. Posted by Aurelio (had 2006 views)
Hi Aurelio,
This is the default behavior in the Grid for.net.
If you check the “Solid Foundations” samples, once you insert a row, the first cell is focused for insertion.
Isn’t this what you are getting?
Imported from legacy forums. Posted by Michel [Xceed] (had 197 views)
Hi. Sorry but i haven’t known explain it as well as i wanted.
After the insertion of the row in the grid, i would like :
1- Put the focus in the insertionrow (i konw that is the standard behavior of the grid)
2- Put default values in the cells of the insertionrow (i have done yet)
3- Activate the edition mode of the insertionrow to let see the default data and edit it.
Here is my problem , to see the default values i have put in the insertionrow’s cells, the row must be in edit mode =on. I know that i have to activate the edition but i don’t konw where i have put the sentence.
I am trying to do a continuos insertion mode (as in WPF’s grid).
Thanks
Imported from legacy forums. Posted by Aurelio (had 279 views)
Hi Aurelio,
In this case, you can handle the EditBegun event on the insertion row and set your default values:
for example:
insertionrow.EditBegun += new EventHandler( insertionrow_EditBegun );
private void insertionrow_EditBegun ( object sender, EventArgs e )
{
try
{
InsertionRow newrow = ( sender as InsertionRow );newrow.Cells[ “EP_Create” ].Value = 0;
newrow.Cells[ “GroupName” ].Value = “test”;
}
catch( InvalidOperationException ex )
{
MessageBox.Show( ex.Message );
}}
Imported from legacy forums. Posted by Michel [Xceed] (had 1392 views)
-
AuthorPosts
- You must be logged in to reply to this topic.