This question is locked. New answers and comments are not allowed.
Hi
I have a grid that is bounded to a ViewModel Collection<Entity>.
When I add a row to the collection the grid is refreshed and the new row becomes visible.
I need to put a cell in the new row in edit mode automatically, by setting the :
cell.IsInEditMode = true;
The problem is that "DataLoaded " fires before the view is refreshed, so my code cannot find the new row, and fails:
private void linesDataGrid_DataLoaded(object sender, EventArgs e)
{
if (_viewModel.IsPutEditModeOnNewRowEnabled)
{
RadGridView linesDataGrid = (RadGridView)CustomVisualTreeHelper.SearchFrameworkElement(_receiptDetails, "linesDataGrid");
GridViewCell cell = TelerikGridHelper.GetCellByIndexes(linesDataGrid, _viewModel.Lines.Count, 2);
cell.IsInEditMode = true;
_viewModel.IsPutEditModeOnNewRowEnabled = false ;
}
}
I also tried _RowLoaded , this had the same result.
I have a grid that is bounded to a ViewModel Collection<Entity>.
When I add a row to the collection the grid is refreshed and the new row becomes visible.
I need to put a cell in the new row in edit mode automatically, by setting the :
cell.IsInEditMode = true;
The problem is that "DataLoaded " fires before the view is refreshed, so my code cannot find the new row, and fails:
private void linesDataGrid_DataLoaded(object sender, EventArgs e)
{
if (_viewModel.IsPutEditModeOnNewRowEnabled)
{
RadGridView linesDataGrid = (RadGridView)CustomVisualTreeHelper.SearchFrameworkElement(_receiptDetails, "linesDataGrid");
GridViewCell cell = TelerikGridHelper.GetCellByIndexes(linesDataGrid, _viewModel.Lines.Count, 2);
cell.IsInEditMode = true;
_viewModel.IsPutEditModeOnNewRowEnabled = false ;
}
}
I also tried _RowLoaded , this had the same result.