Hide horizontal separator lines in RadGridView

1 Answer 35 Views
GridView
Michael
Top achievements
Rank 1
Michael asked on 27 Sep 2021, 04:17 AM

How can I hide the lines between the rows? (I use Office2019 theme)

I already tried this:

        private void RadGridView_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            e.CellElement.DrawBorder = false;
        }

Gridlines are gone but the horizontal lines are still there.

1 Answer, 1 is accepted

Sort by
0
Nadya
Telerik team
answered on 28 Sep 2021, 09:40 AM

Hi, Michael,

In the Office2019Light theme, you should set RowElement.DrawBorder property to false as well in the CellFormatting event:

private void RadGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.CellElement != null)
    {
        e.CellElement.DrawBorder = false;
        e.CellElement.RowElement.DrawBorder = false;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.DrawBorderProperty, ValueResetFlags.Local);
        e.CellElement.RowElement.ResetValue(LightVisualElement.DrawBorderProperty, ValueResetFlags.Local);
    }

}

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Nadya
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Michael
Top achievements
Rank 1
commented on 29 Sep 2021, 07:30 AM

Thank you very much, with this I get the desired result!

For me the question is perfectly answered.

Tags
GridView
Asked by
Michael
Top achievements
Rank 1
Answers by
Nadya
Telerik team
Share this question
or