Hi
I am using Infragistics 12.1 with visual studio 2010 and operating system is Windows 7.
I am facing an issue of the selected item indentation that if I set the margin of any CellValuePresenter greater than zero, then upon selecting that record the indentation is removed the margin is set to zero and upon deselecting the margin is restored.
In fact I have bound a hierarchical data to xamDataGrid, where I show the first column as hierarchy and the remaning columns are aligned as shown in the bellow picture.
Here in this grid the margin is set for each CellValuePresenter in the ‘Name’ column according to the record depth.
Now the problem is that if I select any record the indentation or margin is set to zero on the selection as shown in below picture.
And when the record is deselected the indentation is restored.
If I set SelectionTypeRecord to none then it is okey, but we cannot do that because then we will not be able to select a record.
I have written my custom code to maintain the margins on the selection, but that affects the performance a lot.
I googled a lot to find out the solution but I did not come across one.
The issue is not produced on Windows Xp, there may exists any Property on the XamDataGrid setting of which can fix the problem, I don’t know.
Kindly help me to find out the solution
Thanks
Thanks and regards
Hello Allana,
I was just wondering did you have a chance to try my suggestion. If you still need any assistance on the matter, please do not hesitate to ask.
I have been looking into your issue and I believe that the mentioned behavior is caused because when you select a record some of the default XamDataGrid styles has been triggered . This may set the Margin property with higher priority than the style that you crated. Therefore I can suggest you try the following code snippet in order to set the margin:
<Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="marginStyle" >
<Setter Property="Margin" Value="3"/>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type igDP:DataRecordPresenter}}, Path=IsSelected}" Value="True">
</DataTrigger>
</Style.Triggers>
</Style>
Please let me know if you need any additional assistance on this matter.