User (Old forums)MemberAugust 16, 2007 at 9:55 amPost count: 23064
I have a datagrid, with only one row editable.
well, when I press Enter, I would to move the focus to the next edirow
| read only | read only | EDITABLE 1 |readonly|
| read only | read only | EDITABLE 2 |readonly|
| read only | read only | EDITABLE 3 |readonly|
I woul like to pass from EDITABLE 1 to 2 when I press Enter in EDITABLE 1.. etc.
It is possible?
Imported from legacy forums. Posted by serhio (had 3430 views)Xceed SupportMemberAugust 16, 2007 at 3:46 pmPost count: 5658
You could try something like this in the grid’s KeyDown event:
private void EnterKeyDown( object sender, KeyEventArgs e )
if( ( e.Key == Key.Enter ) || ( e.Key == Key.Tab ) )
int index = this.OrdersGrid.CurrentColumn.VisiblePosition;
Xceed.Wpf.DataGrid.DataRow currentRow = this.OrdersGrid.GetContainerFromItem( this.OrdersGrid.CurrentItem ) as Xceed.Wpf.DataGrid.DataRow;
int currentIndex = this.OrdersGrid.Items.IndexOf( this.OrdersGrid.CurrentItem );
this.OrdersGrid.CurrentColumn = this.OrdersGrid.Columns[ “ShipCountry” ];
this.OrdersGrid.CurrentItem = this.OrdersGrid.Items[ currentIndex + 1 ];
e.Handled = true;
Where “ShipCountry” represents the name of the column that is editable.
Imported from legacy forums. Posted by Jenny [Xceed] (had 1374 views)User (Old forums)MemberAugust 20, 2007 at 4:26 amPost count: 23064
‘Xceed.Wpf.DataGrid.DataGridControl’ does not contain a definition for ‘GetContainerFromItem’
Imported from legacy forums. Posted by serhio (had 506 views)User (Old forums)MemberAugust 20, 2007 at 4:59 amPost count: 23064
Thanks 4 your help, Jenny!
Xceed.Wpf.DataGrid.DataRow currentRow = this.dgcMainDataGrid.ItemContainerGenerator.ContainerFromItem(this.dgcMainDataGrid.CurrentItem) as Xceed.Wpf.DataGrid.DataRow;
works for my version! 😉
Imported from legacy forums. Posted by serhio (had 588 views)
- You must be logged in to reply to this topic.