Hello,
I need to create a column in the grid that is used as a row selector that is a column of checkboxes, however, the column isn't bound to any item in the data. We'd also like for a checkbox to be in the header that would check all items or uncheck all items in the column.
Is this something that can be done, if so, does anyone have any suggestions how to?
Thanks.
Hi,
Generally, i'd recommend using a ViewModel for managing this.
However, if you're locked into the data, you can create a custom column, and store the isChecked state on the cell, i already happen to have a sample that shows this, here:
To check/uncheck all the rows, when the checkbox in the header is clicked, you would hook up an event, to the checkbox, and walk through all of your rows, and update the Ischecked property on each cell.
Hope this helps,
-SteveZ
Yeah the Zip file didn't have all the project files, I just ended up doing it another way, (by creating an boolean property on my class that's being bound to the grid) - I didn't want to do it that way because really that data object is used other places so adding that property is kind of a hack.
Steve, can you maybe repost that Zip file again? I kind of would like to see how you implemented it.
I also need to implement same functionality using XAMGrid v 10.3. I saw your post and sample provided. But downloaded sample didn't contains any thing. Kindly help by providing the same sample or By other way.
I try to implement this functionality, but didn't able to find the checkbox control reference from cell. cell.control always returing null.
Thanks Steve, the zip file helps, I got it to work.
Is there an example already out there somewhere that shows how to do it with a ViewModel?