Hi
I am using field settings CellValuePresenterStyleSelector to provide custom StyleSelector but apparently it is not reevaluated on ItemChanged of the underlying data collection.
Is there a way to force the reevaluation and to force the call to SelectStyle?
Thank you
Hey,
Yes, it is the same exact sample as the other issue. I just did both on the same one. I actually had the CellValuePresenter one done first, and then learned you had the other issue which I looked into. So, the CVP issue is in that sample also.
The DataValueChanged event was introduced in 9.2, so you should have it. Im not sure when the Direct events were introduced. The Direct events are just lighter weight clr events that are not routed so there is less overhead. If there is no Direct event, the DataValueChanged is just fine to use. That will take care of any database or data level changes not made via the UI. The cell updated event will take care of the changes via the UI. This should take care of your problem.
Let me know.
Hi Steve
Thank you for your reply.
I have downloaded the sample.
It resembles the sample about the grid scrolling issue in a different thread but missing two files which I did not investigate if significant.
I have one preliminary question though.
The sample refers to event
DataValueChangedDirect
I assume this is newly exposed event on the xamDataGrid.
We are currently using version 10.2.20102.2139. and we are targeting framework 3.x
I am guessing also I would need to create separate support request about this one using the exact version information and targeted framework.
Hello,
The CellValuePresenterStyleSelector will not do everything that you need. It will not re call the StyleSelector class to re evaluate the style of the cellValuepresenter on value changes. However, I have a little workaround that will help you out. You can handle these two events, DataValueChangedDirect and CellUpdated to handle when the source changes(DataValueChanged) and when the user updates the cell(CellUpdated) and you can change the style of the CellValuePresenter directly right there. I have attached a sample that demonstrates this. Please take a look.
I have reproduced your exact issue. I will need to do a little more research on this because what I have seen from other control vendors and the ms grid view control, this functionality does not seem to be implemented for performance reasons. I will discuss this issue with our developers to see if this is possible.
Also, a style selector may be overkill for what you need. You may be able to get away with a trigger via a style. Please let me know your scenario and I will do my best to help.