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
2320
Disable Cell Editing on a Row by Row basis?
posted

I have a combobox control in a XamGrid that I need to disable on a row by row basis (depending on values in other columns).  I also need to be able to set a tooltip on the cell to explain to the user why they cannot change the combobox for that cell. 

I see IsReadOnly at the column level but this won't help me in this case.

Is this possible in an XamGrid? 

Parents
No Data
Reply
  • 40030
    Offline posted

    Hi, 

    I would recommend using a ValueConverter via a binding on the IsEnabled property of your ComboBox, you can do the samething for your tooltip. 

    <ComboBox IsEnabled={Binding Converter={StaticResource yourConverter}/>

    The value of the IValueConverter will be your underlying data, so you'll be able to do your validation, and you can return true if it should be enabled for false if it shouldn't be. 

    For the tooltip, you can write another converter, and return the text that should be displayed, or update the visibility, if the text is always the same. 

    -SteveZ

Children
No Data