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
630
Disable selection of individual records?
posted

I'm brand new to this environment, so please excuse me if this is a stupid question... :-)

I have implemented a hierarchical XamDataGrid and adapted Josh Smith's great article that shows how to add checkboxes to the record selectors in the grid. My question is this:

I have a case where I need some of the records to be visible but not selectable, so is there a way to programmatically disable the checkbox on individual lines in the grid?

Thanks for any advice you can throw my way!

Regards,

Bob

Parents
  • 6867
    Verified Answer
    posted
    If you are using the approach outlined in my article, you can bind the CheckBox's IsEnabled property to a corresponding property on the ViewModel object (the one that has the IsChecked property in my example).  If that doesn't work out for you, set a handler up for the Loaded event of the CheckBox in XAML, and in the code-behind's event handling method, set the CheckBox's IsEnabled to false if necessary.
Reply Children
No Data