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
270
Change the Default Height and Width of Metro Theme
posted

Hi,

I am looking for some help to reduce the default height and width of a cell provided by Metro Theme for a XAMDataGrid. The default height and Width of a cell in Office2010 theme is what we would like to have.

We have upgraded from Infragistics 11.1 to 13.2. The number of screens is way too many to be manually applying a override for each grid.

Is there a way we could edit the theme XAML and have this functionality applied to all Grids?

Thank you in advance

Regards

Aniket Shetty.

Parents
  • 34510
    Offline posted

    Hi Aniket,

    You can include the Theme XAML in your application and use it directly instead of setting the Theme property on the XamDataGrid itself.  Just add the ResourceDictionaries from the DefaultStyles folder located here:

    C:\Program Files (x86)\Infragistics\2013.2\WPF\DefaultStyles\DataPresenter

    You only need to add the dictionaries that belong to the style you want to use.  You will also need to include their dependencies.  For example, the normal Metro theme requires the following dictionaries:

    DataPresenterGeneric.xaml

    DataPresenterGeneric_Brushes.xaml

    DataPresenterGeneric_Express.xaml

    DataPresenterMetro.xaml

    DataPresenterMetro_Brushes.xaml

    DataPresenterMetro_Express.xaml

    In your App.xaml, you can add the DataPresenterMetro.xaml ResourceDictionary so it applies to all XamDataGrids in the application. 

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Themes\DataPresenterMetro.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>

     

    From this point on you can modify the theme xaml as you like.

Reply Children