I have a DataGrid with CellEditingTemplate , How can i force the first cell of the DataGridRow to enter edit mode when a row is loaded. I tried a few things but nothing seems to work.. thanks..
0
votes
Implementing this is not difficult but row loading is a tricky business in Virtualized environment like datagrid's items. Because when we scroll up and down, rows which were previously loaded will load again and thus put their first cells in edit mode. So you will have some rows which are newly scrolled into view, with their first cells in edit mode. Is this what you want?
- WPF-it
It doesn't have to be on row loaded event,all i want is the first cell of the first row to be in edit mode- it's a costumer request.
- eyall
Oh and more thing i forgot to mention, i'm using mvvm.
- eyall
1 Answers
0
votes
DataGridCell has IsEditing property, which if you set to true puts the cell in edit mode. So in the first column put this true in a style targetted to the datagrid cell type...
<DataGridTemplateColumn ...>
<DataGridTemplateColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="IsEditing" Value="True" />
</Style>
</DataGridTemplateColumn.CellStyle>
</DataGridTemplateColumn>
Let me know if this helps.