Hi,
can you please tell me how can I set row in xamlwebgrid to read only based on a cell's value.
I want to do something like this
foreach (Row row in dataGrid.Rows) {
if(row.Cells["abc"].Value == "Yes")
set the only the selected row to read only
}
Thanks for the help.
There isn't a property on the grid to do so.
However, you can listen to the cell entering edit mode event, and cancel it based on the cell's value.
Hope this helps,
-SteveZ
Thanks for the reply.
We do not have property in xamwebgrid "e.EditingCanceled" inCellEnteredEditMode,only have it on CellExitingEditMode :((
any other suggestion?
Thanks
Yes,
Don't use the CellEnteredEditMode event, use the CellEnteringEditMode event.
CellEnteringEditMode has a property on the event args called cancel.
Just set it to true, to cancel edit mode.
e.Cancel = true;