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.
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.
Thank you Rob. We appreciate your response to the thread.
We tried the approach you recommended, we removed the min height and width settings etc.
However there is no impact on the GUI
Any thoughts?
Thank you
Aniket Shetty