Hello. I would simply like to disable a column in the XamDataGrid. I know I can do this:
((XamDataGrid)sender).FieldLayouts[0].Fields["Total"].Settings.AllowEdit = false;
but I want the column to took like if I was going to do something like this:
((XamDataGrid)sender).Records[2].IsEnabled = false;
So grayed out.
How can I do this?
Thanks
Hello Kris,
I believe that setting the IsEnable property of the CellValuePresenters that are displayed in the same field, will help you achieve the functionality you need. Below is a code snippet that grey out the cells in a specific field and does not allow editing:foreach (DataRecord record in ((XamDataGrid)sender).Records) { if (record != null) { CellValuePresenter.FromCell(record.Cells["name"]).IsEnabled = false; } }I hope it will be helpful for you.