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
1150
How to style XamGrid selected/active row ?
posted

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.

Parents
  • 17475
    Offline posted

    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.

Reply Children