Hello Everyone,
I am working on nested Datagrid(Parent-child) grid in wpf. I am successful in binding the children to a row by using
<DataGrid.RowDetailsTemplate>
<DataGrid.RowDetailsTemplate>
But my problem is that I want to expand my child Grid also so that that every child row consists of another grid means the flow will be like this
Each Parent Row---> Contains Child Grid
EachChildRow------> Contains Sub child grid
Parent----Child-----Subchild
I am successful in working Parent--Child but my problem is that I am unable to attatctch a sub child grid to my child grid.... Comming excatly I am unable to attach a click event to that button... I attatch the click event to the expand button... The app is not running See the code for the expand button in Child grid
//Button Present in Parent Grid For Expanding Child... Working Correctly
<DataGrid>
<DataGridTemplateColumn Header="C" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Name="stk">
<Button x:Name="btnCollapse" {Binding KitGroupingID}" Clickquot;btnCollapse_Click" >
<Image Source="../images/Plus.png" ></Image>
</Button>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
.
.
.
.//Exapnding Code
.
.
.
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
<DataGrid>
<DataGrid.Columns>
<DataGridTemplateColumn Header="D" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<Button x:Name="btnCollapseChildren"<big>Click="btnCollpaseChild_Click"</big> >
<Image Source="../images/Plus.png" Cursor="Hand" Height="20" Width="15" Name="imgExpandChild" ></Image>
</Button>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
You see the above code... If I add a click event to the child Grid I am getting Issue to Please solve my problem