Click here to Skip to main content
16,007,779 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to move focus of datagrid cell to next cell in wpf
Posted

1 solution

Hi,

SelectionUnit="Cell" IsSynchronizedWithCurrentItem="True"
Set the above properties for DataGrid and in the code behind do the following changes.

DataGridCellInfo info = new DataGridCellInfo(this.dataGrid.Items[2], this.dataGrid.Columns[1]);
 this.dataGrid.CurrentCell = info;
 this.dataGrid.SelectedCells.Clear();
 this.dataGrid.BeginEdit();
 this.dataGrid.CommitEdit();
 this.dataGrid.CurrentItem = info.Item;
 this.dataGrid.SelectedCells.Add(info);


Hope it helps.

Regards,
Kannan. S
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900