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
80
Use OptionSet in multiple columns
posted

Hi,

I have two columns in my grid. I want to use RadioButton to display boolean value in those two columns, and the RadioButtons should be mutual exclusive on the same row. In the only sample I can find in knowlegebase, only one button can be checked for the whole grid. Can someone please tell me how I can select more than one RadioButton for different rows, and make it mutual exclusive only on the same row?

Thanks.

 Simon

  • 469350
    Verified Answer
    Offline posted

    Hi Simon,

    There no built in way to do this, but it should be easy enough to code.

    So basically, what you would do is handle the CellChange event of the grid. In this event, you can't use the Value proeprty of the cell, because Value comes from the underlying data source and that won't have been updated, yet. Instead, examine the Text property of the cell. 

    Then you can set the Value on the other cell to the opposite value. You may need to use a flag or the EventManager to prevent recursion, since setting the Value on the other cell might cause CellChange to fire for that cell.