Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
Setting CellValuePresenterStyle does not auto-refresh
posted

I'm trying to set a static style to the property "CellValuePresenterStyle" of a field, e.g. with some particular background color. However, the field does not get refreshed to reflect the new style.

----------------------------------

 

 

 

object style = xamDataGrid1.TryFindResource("LightGreenBackgroundStyle");

xamDataGrid1.FieldLayouts[0].Fields[0].Settings.CellValuePresenterStyle = (

Style)style;

------------------------------

In the previous 9.1 version , we had a work-around to this problem. i. e. in code, we collapse a record then make it visiable again.

But it does not work anymore in 9.2 version!

Attaching a simple project to reproduce the situation. In the project, supposingly if you click on any cell of the grid, the background color of the first column should become light green.

With 9.1 version it works with the work-around I mentioned.

With 9.2 version it never works. (Feel free to change the reference lib yourself to try out).

 

Thanks for the help!

ChangeCellBackgroundAtRuntime.zip