Change BackColor of PinnedColumn

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

    Posted 31 May 2016 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
    1850 posts

    Posted 01 Jun 2016 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. Dario Concilio
    Dario Concilio avatar
    159 posts
    Member since:
    Apr 2016

    Posted 06 Jun 2016 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