I need to know is it possible to disable a specific cell edit in a DataGrid, without disabling edit for the entire column in Silverlight 4. I can get the specific cell object as a FrameworkElement but it does not contain property IsReadOnly or IsEnabled.
You will probably ask: Why do I need that? Well my application requires disabling particular cells in row depending on the other cell content. Each row is being checked this way separately.
If you have an idea how I can achieve such a unusual behaviour please write 😉
C# – Disabling specific cell edit in DataGrid
cdatagridsilverlight
Best Answer
If you have the row,column index of the cell/cells that you wish to have disabled:
Then you can listen to the events CellEnter and CellLeave and do the following:
You're still setting the entire column to Readonly, but since you are resetting it back after you leave the cell it has the effect of appearing to only work for the cell.