Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
275
Read only cells and scrolling problem
posted

I have a grid with enough records to cause the vertical scroll bar to appear.  Some of the cells in a particular column are set to read only.  When I scroll, the read only cells change and different cells end up being read only - it seems to randomly apply the read only to different cells in the column.

I set the individual cells to read only like this:
CellValuePresenter cvp = CellValuePresenter.FromCell(((DataRecord)myXamDataGrid.Records[rowIndex]).Cells[columnName]);
cvp.IsEnabled = false;
cvp.Background = Brushes.Red;

Is there another way I can set indivdual cells to read only?  Or, are there any settings I could alter to prevent this issue from happening?  I tried different ScrollingMode and RecordLoadMode settings but the problem didn't go away.

Thank you,
Mike