vendredi 26 mai 2017

Conditional CheckBoxes in WPF RadGridView

I'm trying to understand the best path forward to implement a column of CheckBoxes in a RadGridView. The CheckBoxes need to be conditionally visible (or hidden) per row-level business logic (a boolean value).

While I have been able to implement this successfully using a DataTemplateSelector, which switches in either a CellTemplate containing the CheckBox, or an empty CellTemplate... I am still having a challenge with controlling the UI behavior. What happens is if a user clicks the empty cell, it goes into Edit Mode, as if accepting text; I don't want this to happen... it should remain empty and not allow any interaction. For the cell with the CheckBox, I can click inside and toggle the CheckBox on and off, which is great... but if a user clicks just outside the CheckBox but still inside the cell where the CheckBox resides, it too will enter Edit Mode, as if accepting text. Again, I don't want this to happen.

What's the best path for allowing only a checkbox inside such a column, and disallowing any UI elements other than the conditionally appearing CheckBoxes?

Thanks in advance for your help.




Aucun commentaire:

Enregistrer un commentaire