Hello,
I am using xamDataGrid and it does a great job. At the moment I try to optimize the userexperience and make the GUI as clear as possible.
The xamDataGrid shows a list of employees, where the Background of the name is datadriven. When I select one or multiple rows I would like to set the background of the selected rows in a different color. It seems that the Background has a higher priority - it always wins. The background of a selected row in the column RESSOURCEN_NAME is correct when the mouse is over that cell. All other columns work as expected - the don't have additional color settings.
It would be great if there is a way to achive this - or alternativly to show a thick border in a different color on all selected rows.
Thanks
Niko
<igDP:XamDataGrid.Resources> <Style TargetType="{x:Type igDP:DataRecordCellArea }" x:Key="HighlightSelection"> <Setter Property="BackgroundActive" Value="#0CA80E" /> <Setter Property="BackgroundSelected" Value="#0CA80E" /> </Style> </igDP:XamDataGrid.Resources>
<igDP:Field Label="Ressource" Name="RESSOURCEN_NAME" AllowEdit="False"> <igDP:Field.Settings> <igDP:FieldSettings> <igDP:FieldSettings.CellValuePresenterStyle> <Style TargetType="{x:Type igDP:CellValuePresenter}"> <!-- There is no difference if I keep the next two lines or not --> <Setter Property="BackgroundActive" Value="#0CA80E" /> <Setter Property="BackgroundSelected" Value="#0CA80E" /> <Setter Property="FontStyle" Value="{Binding DataItem.RessourcenFontStyle}" /> <Setter Property="Background" Value="{Binding DataItem.Color}" /> </Style> </igDP:FieldSettings.CellValuePresenterStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field>
Hello Nikolaus,
I am just checking if you have any further questions on this matter.
Please do not hesitate to let me know if you do.
Sincerely,
Radko
Senior Software Developer
Hello Radko,
I can confirm that i sorts and filters again - thanks!
Yes, filtering and sorting will not be working because I sent you a sample with the TemplateField using alternate binding bound to the data item itself (not a data item’s field). Here is my suggestion on how to fix this:
You need to change back the TemplateField to use name binding and then change the binding in the text block to obtain the field of your choice from the DataRecordPresenter (for example). Here is how to change the template field definition in the above sample:
<igDP:TemplateField Name="Name" Label="The Name" AllowRecordFiltering="True">
<igDP:TemplateField.DisplayTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Margin="3"
Background="{Binding RelativeSource={RelativeSource AncestorType=igDP:DataRecordPresenter},
Path=DataRecord.DataItem.FavColorBrush}" />
</DataTemplate>
</igDP:TemplateField.DisplayTemplate>
</igDP:TemplateField>
PS: In the above code snippet I’ve also enabled the filtering for this field so you can see it working.
me again :-)
I receive reports from my customers that the filtering and sorting of these columns does not work any more. Do I need to set here additional configuration to enable it for these columns as well?
Thank you for your feedback.
I am very glad that you have manage to resolve the issue.
If you require any further assistance, please do not hesitate to ask.
Radko Kolev
Infragistics Inc.
www.infragistics.com/support