This is a migrated thread and some comments may be shown as answers.

outlook column shading

1 Answer 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
randall
Top achievements
Rank 1
randall asked on 03 Dec 2009, 12:14 AM
hi,
i know how to make the header of a column change color.
but how can i make the selected column change light gray like outlook 2007 does in all the cells below the header?

randall

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 03 Dec 2009, 09:37 AM
Hi randall,

You can do this by handling CellFormatting event. Please consider the code snippet below:

void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.CellElement.IsCurrentColumn && !e.CellElement.IsCurrent)
    {
        e.CellElement.DrawFill = true;
        e.CellElement.BackColor = Color.LightGray;
        e.CellElement.GradientStyle = GradientStyles.Solid;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
    }
}

Should you have any questions, don't hesitate to ask.

Regards,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
randall
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or