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
85
Binding CellValuePresenter.IsSelected with Styles codebehind
posted

I'm currently trying to rewrite one of my applications with the xamDataGrid.
Before that i used the WPFToolkit datagrid.

I need to bind with Styles in the code behind.

This does work:

                    CellStyle.Setters.Add(new Setter()
                    {
                        Property = CellValuePresenter.TagProperty,
                        Value = new Binding("DataItem.[2008].Flag")
                    }
                    );

This doesn't work:

                    CellStyle.Setters.Add(new Setter()
                    {
                        Property = CellValuePresenter.IsSelectedProperty,
                        Value = new Binding("DataItem.[2008].IsSelected")
                    }
                    );

 

It is basically the same operation, but for some reason the IsSelectedProperty doesn't execute the binding.

With  WPFToolkit grid this still works and though i know that there are better ways to accomplish this task with the xamDataGrid, i would have to rewrite much of my coding.


Does anybody know what i can do, or what is different with the IsSelectedProperty??


Thx
Johannes