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.
Sure. Sorry about that, i was doing too many things at once when i posted it.
Hi Stevez,
Thanks for the sample. Its working now.