Hello,
I styled the cells of a XamGrid to display a gradient background without any border lines using this XAML code:
<Style x:Key="GridCellStyle" TargetType="ig:CellControl"> <Setter Property="Background" Value="{StaticResource GridRowBackgroundBrush}" /> <Setter Property="BorderThickness" Value="0" /></Style>
<ig:XamGrid CellStyle="{StaticResource GridCellStyle}">
This is working fine.But I could not find a way to style the selected active row. How to do this?When I select a row, it turns blue and the cell borders are visible again...
Thanks.
Hello Josef,
In order to set style selected row I advise you to retemplate the whole style for the CellControl. You could find the style for the CellControl in the generic.xaml file in the \Infragistics\NetAdvantage 2012.1\WPF\DefaultStyles\XamGrid\. There you could define your own brushesh for CellRowHoverBackgroundBrush, CellItemSelectedBackgroundBrush or change the default brushes. They are used when certain action appears (e.g. mouse is over the cell, the cell is selected , etc.). By changing these brushes the rows are displayed as you wish even when there is a selected/active row.
Please feel free to let me know if this helps you in resolving your issue.
Hello Maria,
thank you for this hint.Unfortunately I am relatively new to WPF/XAML and have no experiences with retemplating so far.Do I have to copy the whole template XAML <Style TargetType="ig:CellControl"> ... </Style> from the generic.xaml to my windows resources and edit them there?Or is it possible to use keep the generic template and modify only the brush properties?
It would be nice if you could provide me a simple sample how to do this.
I have made a sample project where I retemplated the CellControl. In order to change the brushes for the background of the selected/active item you should copy the whole style for the CellControl and the brushes that are used. Then you could change the brushes so that the colors of the cells are different. If you want the borders not to be displayed, you could set the BorderThickness to zero. Please look at the sample and let me know if you have any other questions.
This is a wrong project XamGridGroupByTextCutOff
Hello Rajib,
This forum thread is related to the selected/active row style. The project that was attached illustrates how the default template could be modified to achieve slightly different styling. Please note that the styles that are used are located under the App.xaml file. Would you please be more specific on what the issue with the shared solution is so I could try to assist you further?