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
90
Changing row style and AllowEdit based on column value.
posted

I am using the xamDataGrid in an XBAP and I need to know how to change a single row's style and AllowEdit property based on whether the value in one of the columns is null or not.  

So: If Column A is not null, the row should be read-only and have style 1, but if Column A is null, the row should be editable and have style 2.  

Column A is collapsed and non-editable, so there is no need to worry about its value changing during operation.  The xamDataGrid is bound to a DataTable, and I am working in C#.

Parents
No Data
Reply
  • 9694
    posted

    You could bind the AllowEdit property to the data and add a custom IValueConverter which returns true or false based on the value of the data.

    If you'd like me to write some code to demonstrate, I'd be happy to.

Children