Is it possible to make a cell editable while in add new row mode and make readonly when its in Edit row cell
Perfect Thanks
IsReadOnly is off EditableColumn, the column object you get of e.Cell.Column would be an Column or ColumnBase object so you would need to cast it up to the correct level before setting that field.
EditableColumn ec = e.Cell.Column as EditableColumn;
if (ec!=null)
{
// do something
}
Now if the column is always read only, then you could set that flag either in the Xaml or one time in code, probably in the page loaded or grid loaded event.
If you can't set that flag and you wanted to not allow editing on a cell for a given column you would add
in the CellEnteringEditMode
if (e.Cell.Row.RowType == RowType.DataRow && e.Cell.Column.Key == "myKeyToNotAllowEditingOnThisColumn")
e.Cancel = true'
But it does not show intellisence for the .IsReadOnly?!
If you want to do it for one column and it with the cell's column Key value
The user should be able to add and edit using the grid so I cannot turn off editing for grid
The CellEnteringEditMode looks like doption, but can I restrict it to only one cell that should not be editable in grid all others should be editable
If I give as below it disables editing for all columns in cell
private void Grid_CellEnteringEditMode(object sender, BeginEditingCellEventArgs e) { if (e.Cell.Row.RowType == RowType.DataRow) { e.Cancel = true; } }