Change BackColor of PinnedColumn

3 posts, 1 answers
  1. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 31 May Link to this post

    Hi to all,

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

    How can I do?

  2. Answer
    Dess
    Admin
    Dess avatar
    1607 posts

    Posted 01 Jun Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 06 Jun in reply to Dess Link to this post

    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

Back to Top