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
295
Styles via code behind.
posted

i am to implement the style via code behind. i am able to create styles thru code behind.

my question is how can i create nested styles of xamdatagrid's DataRecordCellArea styles. for e.g ForegroundAlternateStyle.

what i found in generic themes of xamdatagrid.

how can i write this via code behind.

 <!--  _________________________ BlackForegroundStyle ______________________________________  -->
    <Style x:Key="{ComponentResourceKey {x:Type igDP:XamDataGrid}, GrayForegroundStyle}">
        <Setter Property="TextBlock.Foreground" Value="#FF333333" />
    </Style>

here is how i m implementing

void ApplyRecordAreaStyle()
        {
            Style recordstyle = new Style(typeof(DataRecordCellArea));

            recordstyle.Setters.Add(new Setter(DataRecordCellArea.BackgroundAlternateProperty, SelectedBackground));

            recordstyle.Setters.Add(new Setter (DataRecordCellArea.ForegroundAlternateStyleProperty ,????????));

            xamGrid.FieldLayoutSettings.DataRecordCellAreaStyle = recordstyle;

        }

Parents Reply Children
No Data