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

Change BackColor of PinnedColumn

2 Answers 172 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dario Concilio
Top achievements
Rank 2
Dario Concilio asked on 31 May 2016, 02:56 PM

Hi to all,

I would change back color of Pinned Column, I would use same color of unpinned columns.

How can I do?

2 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Jun 2016, 09:23 AM
Hello Potito,

Thank you for writing. 

RadGridView has a specific style for the cells belonging to pinned columns coming from the theme. In order to customize the cells, it is appropriate to use the CellFormatting events:
private void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    if (e.Column.IsPinned)
    {
        e.CellElement.DrawFill = false;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
    }
}

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Dario Concilio
Top achievements
Rank 2
answered on 06 Jun 2016, 06:47 AM

Thank for support, I changed backcolor because it was too dark

Private Sub ItemsRadGridView_CellFormatting(sender As Object, e As CellFormattingEventArgs) Handles ItemsRadGridView.CellFormatting
    If e.CellElement.IsPinned Then
        e.CellElement.BackColor = Color.FromArgb(50, Color.LightGray)
    End If
End Sub

Tags
GridView
Asked by
Dario Concilio
Top achievements
Rank 2
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Dario Concilio
Top achievements
Rank 2
Share this question
or