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
570
copy styles
posted

Hello,

I have a xamdatagrid in my application (in xaml).

In code i create a new xamdatagrid (on button click). I want to copy all style properties from the datagrid i have in xaml to the one i create in code. How can i do it without having to define everystyle property from beginning? is there a way to bind these properties? 

Parents
No Data
Reply
  • 138253
    Offline posted

    Hello,

     

    It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking through your post and I suggest you copy the Resources from your XamDataGrid, defined in XAML, to the one defined in code-behind like this:

     

    myGrid.Resources = xamDataGrid1.Resources;
    

     

    If you defined your styles in Window’s or Application’s Resources, without a Key, then they will apply automatically.

     

    Feel free to write me if you have further questions.

Children
No Data