I would like to change the background of column layout header. Please look at the xaml code below:
<ig:XamGrid x:Name="xamGridBehaviorList" AutoGenerateColumns="False" >
<ig:XamGrid.Columns>
<ig:TextColumn Key="Description" HeaderText="Behavior" Width="*" />
</ig:TemplateColumn>
<ig:ColumnLayout Key="Behavior_SaveMonitorForm">
<ig:ColumnLayout.HeaderStyle>
WHAT I NEED TO WRITE HERE TO CHANGE HEADER BACKGROUND
</ig:ColumnLayout.HeaderStyle>
<ig:ColumnLayout.Columns>
<ig:TextColumn Key="ShiftDescription" HeaderText="Shift" Width="*" />
</ig:ColumnLayout.Columns>
</ig:ColumnLayout>
</ig:XamGrid.Columns>
</ig:XamGrid>
You should write a Style with TargetType - HeaderCellControl:
<Style TargetType="igPrim:HeaderCellControl"> <Setter Property="Background" Value="Orange" /> </Style>
You can find more information about the Styling Points of the XamGrid in our Designer Guide.
Regards
Please look at the code below
<Style TargetType="igPrim:HeaderCellControl">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFEFEFE" Offset="0" />
<GradientStop Color="#FFE7E7E7" Offset="1" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<ig:TextColumn Key="CreatedDate" HeaderText="Created Date" FormatString="{}{0:d}" Width="Auto"/>
However the griadient boder does not work. Please help
hi,
I attached a sample that uses code similar to yours. Could you try it and see if you get the same result
It DOES NOT work if i used hex color such as Color="#FFFEFEFE" or Color="#FFE7E7E7", Please help me to find work around solution.
Hi,
I just took a look, and it works just fine. There isn't actually any difference to setting Named colors versus hex, as the sl xaml parser just converts them to hex.
The colors you chose those are pretty much the same colors that are the default.
Here is something more drastic:
<Style TargetType="igPrim:HeaderCellControl"> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFFF6600" Offset="0" /> <GradientStop Color="#FF0033CC" Offset="1" /> </LinearGradientBrush> </Setter.Value> </Setter> </Style>
-SteveZ
Thanks, I found out what i did wrong.