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
130
Styling all xamdatagrid in application using ResourceDictionary
posted

How to style all xamdatagrids in application using resource dictionary.

I want all xamdatagrids in the application to have fieldchooser feature. How can I acheive this functionality by using style at application level.

  • 27093
    posted

    Hello Manoj,

    I am just checking the progress of this issue and was wondering, if you managed to achieve your goal, or if you need any further assistance on

    the matter.

    If the above suggestion helped you solve your issue, please verify the thread as answered, so other users may take better advantage of it.

  • 27093
    posted

    Hello Manoj, 

    I have been looking into your enquiry and I can suggest going through this article in msdn: http://msdn.microsoft.com/en-us/library/ms745683.aspx , to get an overall understanding of styling in WPF. Regarding your particular sample, if you place this Style like: 

    <Style TargetType="{x:Type igDP:XamDataGrid}">
        <Setter Property="FieldLayoutSettings" >
            <Setter.Value>
                <igDP:FieldLayoutSettings HeaderPrefixAreaDisplayMode="FieldChooserButton" />
            </Setter.Value>
        </Setter>
    </Style>

    in the Resources of a parent control, it will affect all XamDataGrid in it and in its child container controls. If you want to affect all the application’s XamDataGrid’s you can put a Style in the Applicaiotn.xaml. Here are also a couple of links on RecourdeDictionaries: http://msdn.microsoft.com/en-us/library/system.windows.resourcedictionary.aspx , http://msdn.microsoft.com/en-us/library/aa350178.aspx that should be helpful. 

    Please let me know, if I can be of any further assistance on the matter.