Hi,
I am using Xceed DataGrid for WPF binding it with an observable collection. I have around 20 columns and i am looking to set the individual cell (not whole column) enable/disable as per my business logic.
I tried setting the same from corresponding .xaml.cs file using:
"((DataRow)dataGrid.GetContainerFromItem(anItem)).Cells[someCell].IsEnabled = false;"
However the setting is not preserved after scrolling or some other rendering. To solve this I decided to go with DataTrigger. Currently i am using one extra property per original property in my class. For example, if there is a column "Name" i am keeping one extra property as "Name_Enabled" to keep the enable/disable information of "Name" property. I am using this "Name_Enabled" property in data trigger to set the "IsEnabled" property of "Name" accordingly. So now i am having 40 columns instead of 20 :(
Is there any better way to acheive this?
Please help!