HI
I have two questions; First is there a way to include a checkbox in the groupbyitemtemplate? I've got the the template working that includes the value and the count, but I am looking for a way to unselect the group so that the coorsponding display (points on a map) can be turned "off" Second question is if there is a way to set the groupbyitemtemplate for all columns or does it have to set for each column independantly?
Thanks for the help
Gregg
Hi Gregg,
I'm not really sure what you mean. If you want a checkbox in the GroupByRyow, you can use the GroupByItemTemplate. Can you provide more detail on where you want the checkbox to be, and what exactly you're attempting to accomplish?
As for your other question, we only provided that property on the Column level, not on the Grid or ColumnLayout level, so you would have to provide it for each column. However, you can define the DataTemplate in a ResourceDictionary, and use the same template on each column via a StaticResource.
-SteveZ
Hi Steve
Thanks for the reply. I've made a little headway but still have a ways to go. I'll see if I can clarify what I'm trying to do. I've gotten the checkbox to appear as I want using this template:
<igDataGrid:TextColumn Key="Event_Type" HeaderText="Category"> <igDataGrid:TextColumn.GroupByItemTemplate > <DataTemplate x:Name="GroupTemplate"> <StackPanel Orientation="Horizontal"> <CheckBox x:Name="GroupCheck" IsChecked="True"/> <TextBlock Text="{Binding Value}"></TextBlock> <TextBlock Text=" (" /> <TextBlock Text="{Binding Count}"></TextBlock> <TextBlock Text=")" /> </StackPanel> </DataTemplate> </igDataGrid:TextColumn.GroupByItemTemplate> </igDataGrid:TextColumn>
Now the next step is to hook up the checkbox "checked" event to an event handler. In the handler I want to loop through each of the rows in the group. In this case to turn off a point on a map. So I guess my current questions are:
1. How do I hook an event handler to the checkbox checked event in code? I'm not sure how to reference the checkbox to set the handler.
2. There are several columns in the grid that will have the same groupbyitemtemplate. Can I name all the checkboxes the same, in this case "GroupCheck" and use one event handler to deal with them all?
3. How do I reference (loop through) the group in the event handler?
Thanks and really appreciate you help.