Hello!
There seem to be (at least) two DataRecordPresenter selected states:1) selected and has the selection color2) not selected but retains the selection color
To reproduce:
1) Ctrl-click on the record, the record is active & selected2) Ctrl-click, again, on the same record, the record is active but NOT selected
However: in 2) the record retains the selected background color!It is this state that I need to somehow detect, hopefully using a trigger!
Reason: for a specific "Field" I have a specific style:
<ig:Field.Settings> <ig:FieldSettings AllowEdit="False" CellValuePresenterStyle="{StaticResource MyStyle}"> </ig:FieldSettings></ig:Field.Settings>
And in MyStyle I want to set the background color for the cell. This happens, but I don't want to set it:
a) on mouse-hover-over the recordb) when the record is "appears" selected, i.e. has the selected background color applied to itc) when the record is being "executed" (our business logic)
Therefore I need to detect this "hidden" selected state!
Note that the Style os for the CellValuePresenter and not for the DataRecordPresenter!
I think this is relevant: if FieldLayoutSettings.SelectionTypeRecord is set to Extended, then do the CellValuePresenter IsMouseOverRecordIsRecordSelectedIsActive
get set to properly reflect the state of the parent DataRecordPresenter?
Property IsMouseOverRecord seems to do just that, but I'm not so sure about IsRecordSelected.
Hello Mark,
Thank you for your post.
The record selection that you are seeing here is actually caused by the default style for DataRecordCellArea, rather than DataRecordPresenter. If you would like to remove it for the entire XamDataGrid, I would recommend writing a style for it and setting the following six properties to “Transparent:” BackgroundSelected, BackgroundActive, BackgroundHover, BorderHoverBrush, BorderSelectedBrush, and BorderActiveBrush.
From there, you can use three triggers for your CellValuePresenter style. I would recommend two DataTriggers and one MultiDataTrigger. Each of these triggers will set the Background property. The two DataTriggers should bind to IsSelected = true and IsActive = true, while the MultiDataTrigger will bind to both being true.
I have attached a sample application to demonstrate the above. In this sample, the cells will turn green when the MultiDataTrigger is hit, red when the IsActive trigger is hit, and Blue when the IsSelected is hit. I hope this helps you.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewDeveloper Support Engineer IInfragistics Inc.www.infragistics.com/support