Hi Team,
I am working on the Xam Grid control. Xam grid Contains a custom pager with some styles.
When a group by is done on the parent grid control. All the child grid controls formed as a result of group by is also inheriting the parent pager settings.
I dont want the parent pager styles to the child. I tried in the following way to remove the styles. But the it is applying for both the child and parent.
<igGrid:XamGrid HorizontalAlignment="Stretch" Grid.Row="1" x:Name="igGrid" AutoGenerateColumns="False" Loaded="igGrid_Loaded" GroupByCollectionChanged="igGrid_GroupByCollectionChanged" >
private void igGrid_GroupByCollectionChanged(object sender, GroupByCollectionChangedEventArgs e) { var childgrid= sender as XamGrid; if (e.NewGroupedColumns.Count > 0) { childgrid.GroupBySettings.GroupByColumns.Grid.PagerSettings.AllowPaging = PagingLocation.None; //((XamGrid)childgrid.GroupBySettings.GroupByColumns.Grid.Parent).PagerSettings.AllowPaging = PagingLocation.Bottom; } childgrid.PagerSettings.AllowPaging = PagingLocation.Bottom; }
Is there any way that it can be done only the child grids?
Hi Manoj,
Pager settings can be set on a per ColumnLayout fashion but when you groupby columns, rows under each grouping are not considered as child rows since they still use the same ColumnLayout as they did without the groupby. In order to hide the pager stuff for grouped rows you'll need to use a style on the PagerCellsPanel which hides it. Something like this:
<Style TargetType="{x:Type ig:PagerCellsPanel}"> <Setter Property="Visibility" Value="Collapsed"/> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Row.Manager.ParentRow}" Value="{x:Null}"> <Setter Property="Visibility" Value="Visible"/> </DataTrigger> </Style.Triggers> </Style>
Hi Rob,
Thanks for the quick reply. I Tried your solution in my silverlight project but i am not able to get the thing done.
I have created sample poc for your reference. If you can replicate the behaviour of our code in my sample it would be great.
sample code: http://1drv.ms/1SQhBYs
Regards,
manoj