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
500
XamGrid - How to deactivate the default hover behvior in column header cells
posted

Hello,
we need to deactivate the default hover behavior of the column header cells.

Up to now I tried the following:

1. I create a TextColumn in code behind:

TextColumn col = new TextColumn();
col.Key = "[rg" + iRG.ToString() + "fct" + iF.ToString() + "]";
col.HeaderText = _selFacts[iF - 1].Name;
col.Width = new ColumnWidth(100, false);
col.HeaderStyle = (Style)FindResource("MyHoverStyle");

The Key is created dynamically and the HeaderText is the name of a Fact (e.g. "Turnover [abs.]"). I set the HeaderStyle.

2. I define the Style for the header in XAML:

<Style x:Key="MyHoverStyle" TargetType="{x:Type igDP:DataRecordCellArea}">
 <Setter Property="BackgroundHover" Value="LightGray"/>
</Style>
           
3. I also tried to change the Brush definitions within the XamGrid.Resources:
<ig:XamGrid x:Name="gridTable1" Grid.Column="0" Margin="0,5,5,5" HeaderRowHeight="Dynamic" AutoGenerateColumns="false" ColumnLayoutHeaderVisibility="Never" KeyboardNavigation="AllLayouts" InitializeRow="gridTable_InitializeRow" Loaded="gridTable1_Loaded" RowExpansionChanged="gridTable1_RowExpansionChanged" ColumnSorting="gridTable1_ColumnSorting" ColumnResized="gridTable1_ColumnResized" ColumnResizing="gridTable1_ColumnResizing">
    <ig:XamGrid.Resources>
        <LinearGradientBrush x:Key="HeaderHoverBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Offset="0" Color="LightGray"/>
                    <GradientStop Offset="0.35" Color="LightGray"/>
                    <GradientStop Offset="1" Color="LightGray"/>
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="HeaderHoverForegroundBrush" Color="LightGray"/>
    </ig:XamGrid.Resources>
</ig:XamGrid>

The use of "LightGray" was only for a test. Probably I should use "Transparent"?

Up to now nothing worked. The standard hover styles are still active. Could you please tell me what I must do?

Regards

 

Parents Reply Children