Hello,
We are using XAMGrid. Here we want to add sub grid in XAMGrid but not for all Rows.So instead of all rows need to add sub grid in some of rows which have data in sub grid. If sub grid collection data is null then In these case simple grid row should be shown instead of sub grid expander.
Please let us aware how we can approach it. Your help would be appreciate.
Thanks
Hello prikanwar,
It sounds like you are asking about how exactly you can manually generate the columns in a XamGrid for a hierarchical layout. If this is the case, I would recommend that you see the following online documentation article where this is discussed: http://help.infragistics.com/Help/Doc/WPF/2015.1/CLR4.0/html/xamGrid_Defining_Hierarchical_Layouts.html.
The gist of that article is that to have a child layout, you will need to point a ColumnLayout existing inside of the XamGrid.Columns collection at the child collection that contains the child band of your hierarchy, and you can do this by setting the Key property of the ColumnLayout, just as you would for the other columns. The ColumnLayout has a Columns collection of its own, which you can use to define the columns that should exist within the child layout.
I have attached a modified version of the original sample project I had sent you to demonstrate this. I hope it helps you.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Hi,
We are very thankful for your reply. we have followed your approach but its not working for us. We have added child data observablecollection and added data in child data but its not showing in grid. here we are going to follow MVVM pattern.
<ig:XamGrid Name="grdCalenderEventPriceEvent" AutoGenerateColumns="false" ItemsSource="{Binding Path=bindCalenderEventPrice}" Grid.Row="0" Grid.Column="0" > <ig:XamGrid.EditingSettings> <ig:EditingSettings AllowEditing="Row" /> </ig:XamGrid.EditingSettings> <ig:XamGrid.SelectionSettings> <ig:SelectionSettings CellClickAction="SelectRow" RowSelection="Single" /> </ig:XamGrid.SelectionSettings> <ig:XamGrid.RowSelectorSettings> <ig:RowSelectorSettings Visibility="Hidden"></ig:RowSelectorSettings> </ig:XamGrid.RowSelectorSettings> <ig:XamGrid.Columns> <ig:TextColumn Key="LocationName" HeaderText="Location" Width="Auto"> <ig:TextColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="Location" FontSize="12" /> </DataTemplate> </ig:TextColumn.HeaderTemplate> </ig:TextColumn>
</ig:XamGrid.Columns> </ig:XamGrid>
In bindCalenderEventPrice we have also added Child Data observable collection .
Please let us aware where we are going to wrong.
Thank you for your post.
From your description of this forum thread, it sounds as if you are looking to allow certain rows in your XamGrid to be hierarchical, where others aren't, and the ones that aren't have no expansion indicator. If this is the case and I have understood your requirement correctly, then it may be helpful for you to know that when the XamGrid deals with hierarchical data sets, it does this by default. If there are no records that exist in the hierarchical levels below the parent level, there will be no expansion indicator shown.
I have attached a sample project that demonstrates a XamGrid with a hierarchical bound ItemsSource. Note that for the rows that have no children, the expansion indicator is not shown. I hope this helps you.