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
405
toggle check box columns
posted

hi i am using ultra grid bound with a data source , i am havig two unbound check box columns in it

 

i wanto toggle between  them if i check on one column so the other one should be unchecked automatically as  i am allowing only one column to select at one time .

  • 469350
    Suggested Answer
    Offline posted

    What I would do is trap the CellChange event of the grid. You can trap for changes to cells in either of the two checkbox columns and then set the other one in the same row to the opposite value.

    One caveat, though, is that you can't use the Value property of the cell to get the value of the current cell in edit mode in the CellChange event. So for the cell that is being changed, you have to use the Text property. You can use Boolean.Parse and pass in the cell text to get a boolean value. Then set the other cell to the opposite of that boolean.