Hi all!
We developed a mixed application, that uses both Windows Forms and WPF Infragistics components. In order to keep a consistent style for the whole application, we need to apply xamGrid the same style we defined for Windows Forms UltraGrid (you can see an example here).
What do you think is the best approach to achieve this result? I think assigning a style to the grid using pure XAML is a very difficult task...
Thank you, bye. Maria
Hello Maria,
I am just checking if the latest reply helped you out or if you require any further assistance on the matter.
Hi Gineva,sorry I was out of office during last weeks.
Thank you for the links you provided. Our goal is to have the same, *identical*, style for the two grids. So the theme solution cannot be applied.
If you know how complex is xamDataGrid, how many nested controls it is made of, then you can understand why I'm saying that also the style solution is not suitable. Am I missing something?
What you're suggesting to do is:
- create a copy of the default style, which is located in "C:\Program Files\Infragistics\NetAdvantage 2011.2\WPF\DefaultStyles\XamGrid" (is it the right folder?);
- manually customize the template, trying to give each nested component the required look.
This is the procedure I followed to style xamDataTree, about an year ago. But, that time, I had to apply only few changes to the tree. Now I have to "totally restyle" the grid...
Thank you, bye.
Hi Maria,
I am glad that you find the answer and post it to our community.
Regarding your questions and answers, that’s way I have asked which grid we are going to re-template to start from scratch and avoid any confusions.
Again , I am glad to that you find a way that suits to your requirements.
Hi Gineva,thank you for taking the time to prepare this sample app.
Unfortunately it does not include all the required resources, so it doesn't compile. Anyway, I figured out what was going wrong in my previous tests.
To answer my questions:1) how to avoid errors on "generic.xaml": simply don't use it;2) why, in my sample project, Office2010Blue style was not applied: of course, I was referencing the wrong files!!
Styles for xamDataGrid's nested controls are contained in this folder: C:\Program Files (x86)\Infragistics\NetAdvantage 2011.2\WPF\DefaultStyles\DataPresenterand not in the folder that I mentioned in my previous posts.
In the meanwhile, I've found a method to customize the style of the grid, that doesn't need to start from the default styles. Styling exactly what I need, using Snoop or making some search on the web to find the correct "styling point" for that particular background color or other style that I need.
So I think we can close this thread. Thank you and have a nice we.Maria
Hi,
As we discussed in order to overwrite XamDataGrid style you have to tahe the default sytyle and modify it, in your case you want to base your styling on some specific them so you can use the theme styles and modify it in the way you want.
The attached sample includes all the necessary resource dictionaries needed in order to use the Office2010Blue theme as a project included theme. Adding the theme as a merged dictionary in the application's resources will allow the theme to automatically apply itself to the XamDataGrid without needing to set the Theme property.
I hope this helps.
The approach is the same for both grid. I was asking because the two different grid recurred different references. So I will focus on XamDataGrid and try to prepare for you a sample using a Office2010Blue them.
I will upload the sample when I finish it.
I'm currently using xamDataGrid. But my original question is valid also for xamGrid: in the future, we may use the other grid, and we may still need to style it...
Do you think we should adjust question's title, by replacing xamGrid with xamDataGrid?