Datagrid V1: TemplateSelector issue and RowStyle issue

Nov 20, 2008 at 8:58 PM
Hi,
I have other issues to ask for.

1.
The first column of the datagrid is an image column created with a DataGridTemplateColumn.
In case that the grid has 100 columns the TemplateSelector will be called 100 times with item parameter is null.
After that the TemplateSelector will be called 100 times with item parameter is not null (that is correct).

How to avoid that situation to improve the performanc
2.
After grouping and cleanup grouping the RowStyle looks different especially the background color of the content is correct, the background color of the cell is not.
When clicking in another row the color is OK again.

Many thanks in advance.
WorstCase


This is the RowStyle I use:

<Style x:Key="dgRowStyle" TargetType="dg:DataGridRow">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Background" Value="White" />
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="Lavender" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="LightSeaGreen" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="true" />
<Condition Property="IsSelected" Value="false" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="LightYellow"/>
</MultiTrigger>
</Style.Triggers>
</Style>

 

 

 

 

 

Nov 23, 2008 at 10:44 AM
Hi,
If no-one replys, does that mean there is no solution?
Or does the problem has nothing to do with DataGrid?

Please post a tip in which other part of the WPF I have to look for.

Thanks.
WorstCase
Coordinator
Nov 25, 2008 at 3:08 PM

Hi WorstCase,

It doesn't necessarily mean either - we're just short on resources (especially around the holidays) and are having trouble keeping up on the volume of questions.  I will try to take a look at your issue but it will likely be a few days.  Thanks very much to you (and to all of the other posters!) for your patience.

Samantha