I have the following style for DataRecordCellArea and CellValuePresenter. I'm still getting the default style to show as double.
When clicking to the right of the radio button of Line "A", it becomes Active. Clicking on the radio button of Line "B" makes Line "A" Selected and Line "B" Active.
Why Line A becomes Selected ?
Please refer to this sample project (Infragistics v17.2)
To replicate this issue:
Run the project, Click to the right of the Radio button (not on it), and click on another Radio button.
<Style TargetType="{x:Type igDP:CellValuePresenter}"> <Style.Triggers> <DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource Self}}" Value="True"> <Setter Property="BorderActiveBrush" Value="Red" /> <Setter Property="BackgroundActive" Value="Green" /> <Setter Property="BorderThickness" Value="0,3,0,3" /> </DataTrigger> <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="True"> <Setter Property="BorderActiveBrush" Value="Red" /> <Setter Property="BackgroundActive" Value="Green" /> <Setter Property="BorderThickness" Value="0,3,0,3" /> </DataTrigger> </Style.Triggers> </Style> <Style TargetType="{x:Type igDP:DataRecordCellArea}"> <Setter Property="BorderHoverBrush" Value="Salmon" /> <Setter Property="BackgroundHover" Value="Salmon" /> <Style.Triggers> <DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource Self}}" Value="True"> <Setter Property="BorderActiveBrush" Value="DarkRed" /> <Setter Property="BackgroundActive" Value="White" /> <Setter Property="BorderThickness" Value="3" /> </DataTrigger> <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="True"> <Setter Property="BorderActiveBrush" Value="DarkRed" /> <Setter Property="BackgroundActive" Value="White" /> <Setter Property="BorderThickness" Value="3" /> </DataTrigger> </Style.Triggers> </Style>
It looks like the first record becomes Selected and the Second becomes Active.
<Style TargetType="{x:Type igDP:DataRecordCellArea}" BasedOn="{StaticResource {x:Type igDP:DataRecordCellArea}}"> <Setter Property="BorderHoverBrush" Value="Salmon" /> <Setter Property="BackgroundHover" Value="Salmon" /> <Style.Triggers> <DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource Self}}" Value="True"> <Setter Property="BorderActiveBrush" Value="Yellow" /> <Setter Property="BackgroundActive" Value="Yellow" /> </DataTrigger> <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="True"> <Setter Property="BorderSelectedBrush" Value="Green" /> <Setter Property="BackgroundSelected" Value="Green" /> <Setter Property="BorderThickness" Value="3" /> </DataTrigger> </Style.Triggers> </Style>
Hi User201,
Thank you for posting in our forums!
I am not sure I understand the issue here. So I may better assist you with this, clarify what it is you are expecting to see in this scenario and what you are trying to accomplish.
If you are referring to the selected color of the row when clicking outside of the radio button, the XamDataGrid has logic separate from your IsSelected property that is selecting the row. You can change this color with the following Style settings:
<Style TargetType="{x:Type igDP:DataRecordCellArea}"> <Setter Property="BackgroundSelected" Value="Transparent"></Setter> <Setter Property="BorderSelectedBrush" Value="Transparent"></Setter>
If you need further assistance with this, please let me know and I will be glad to help.
Hello Michael,
Sorry for the confusion. I'm trying to understand the behavior of the XamDataGrid in this situation.
Please note I will be updating my question to benefit other forum members.
Hello,
Thank you for the clarification!
As you know, the area immediately around the radio button is the grid's RecordSelector with your ControlTemplate inside of it. When you click the RecordSelector, you are telling the XamDataGrid to select this row. At the same time, it is also now the active row, so you only see the active style.
When you click on the radio button, the grid still knows the first row was selected, but you have not clicked on another RecordSelector, only the radio button. The active row still changes, but the first row can now display the selected style.
If you do not want to use the built-in selection, you can set the SelectionTypeRecord and SelectionTypeCell properties to "None" like below:
<igDP:FieldLayoutSettings SelectionTypeRecord="None" SelectionTypeCell="None" RecordSelectorExtent="40" />
You can read more about the built-in selection functionality in the Selection Overview here.
Please let me know if you need more information.