Datagrid V1: TemplateSelector issue and RowStyle issue

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

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
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.

This is the RowStyle I use:

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






Nov 23, 2008 at 11:44 AM
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.

Nov 25, 2008 at 4: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.