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
I will!And - thanks again for the very quick reply!Cheers,Mark
I think removal may have been the wrong word to use on my original reply. What this will do is essentially make all of the background and border states of the XamDataGrid see through for the DataRecordCellArea. It has no other effect than that, so your option b is correct.
This style should have no effect on your ability to use the drag and drop functionality with the DataRecordCellArea.
Thank you, that helps.
You ask: "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".
I'm not sure if I want to do that, or under what circumstances I should do that.
When you say "romove it", do you really mean a) "remove it and it's effects entirely", or just b) the selection and background effects that it produces.I assume you mean b) because in your example the style is, of course, still present.
Currently, we use a style based on DataRecordCellArea as a place to set a Drag & Drop attached property.
Thank you!Mark