views:

214

answers:

1

Hi, I have a datagrid with Grouping ON and whose first col is a Checkbox. I'm looking to have the CheckBox on the Group Level so that the User click one checkbox and it automatically select all the checkboxes under that groud and vicevera.

I also have a Print button which when pressed should have arary of all the rows with CheckBox checked

How can I do that? Any response would be much appreciated

A: 

You need to start by retemplating the RowGroupHeaderStyles to add a CheckBox to the group headers. Then you should be able to iterate the backing collection and set the checkbox value in the event handler for the CheckBox in the GroupHeaders.

The difficult part is that you need to be able to determine what is in the group of the header that fired the event. You should be able to figure this by examining the DataContext of the sender in your event handler. It should be the group that that header represents and from there you should be able to manipulate the items.

Stephan