I am using xamdatagrid and i am having fields as subject,date and from.I am doing group automatically on date.It is displaying as Monday,Yesturday and lastweek.It is ok for me.But when the last week differ with two dates it is displaying lastweek header as twice.How can i overcome this.i will work when i do manually i.e. when i place a header directly in debugg mode.How can i do in xaml.
<igDP:FieldLayout.SortedFields>
<igDP:FieldSortDescription Direction="Descending" FieldName="DisplayDate" IsGroupBy="True" />
</igDP:FieldLayout.SortedFields>
is their any way to do in xaml?
Many Thanks for the reply. But this is not working. Actually i am facing another problem. I have a user control, and on the user control i have few grids. and one of the grid is group by one column. Also i have applied theme and resourcewasher to my grid and i want to override few deafult styles of the theme. I am able to change color of grid header its label, hover color etc etc But the group by background is not working. Also I have used below style for the group by, some how "foreground" is working but not the back ground, but background color is changing the back color of group by area. Below is the style, i am not allowed to attached the project here or the screen shot. Please please help.
<Style TargetType="{x:Type igDP:GroupByRecordPresenter
}" >
<Setter Property="Background" Value
="Aqua"/>
<Setter Property="OverridesDefaultStyle" Value
="True"/>
<Setter Property="Foreground" Value
="Black"/>
<Setter Property="FontWeight" Value
="Bold"/>
</Style
>
Hello Rachita,
I have created a sample project with the functionality you want. Basically I copied the default Style of the DataRecordPresenter and change the Background of a Border called “highlight” in its Template. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
How to apply it in MVVM?
Thank you for your post. I have been looking into it and I suggest you add an EventSetter for the GrouipByRecordPresenter’s Loaded event like this:
<Style TargetType="{x:Type igDP:GroupByRecordPresenter}"> <EventSetter Event="Loaded" Handler="GBRPloaded"/> </Style>
And add the following handler for it:
private void GBRPloaded(object sender, RoutedEventArgs e) { (Utilities.GetDescendantFromName(sender as DependencyObject, "highlight") as Border).Background = Brushes.LightGray; }
Please let me know if this helps you or you need further assistance on this matter.
Hi Stefan,
In the above screen shot, i am using the same kind of grouping in the Xamdatagrid, also using themes and resource washer to the grid.
Though i am able to do further style editing to the grid like "background color" and "font weight" of the xamdatagrid header , but not able to change the background color of the group by area.
In the above screen shot where it is showing "(group by field)+" sign.
I tried GroupByRecordPresenter styling , but it is not changing the background color.
Below is the style i am using
<Style TargetType="{x:Type igDP:GroupByRecordPresenter}">
<Setter Property="BackGround" Value="LightGray"/>
</Style>
Please suggest.