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

Hide cell border in child grid

3 Answers 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 17 Mar 2011, 11:36 PM
I'm looking for a way to hide the cell border of a child grid in a standard hierarchy gridview. I saw posts about removing the thick border around it, but not the cell border. Is it possible?

Thanks,
Andy

3 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 18 Mar 2011, 10:50 AM
Hello Andy,

Yes, you can get rid of borders only on the child template(s) using the ViewCellFormatting event.

private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.CellElement.ViewInfo.ViewTemplate != this.radGridView1.MasterTemplate)
    {
        e.CellElement.DrawBorder = false;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.DrawBorderProperty, Telerik.WinControls.ValueResetFlags.Local);
    }
}

Hope that helps
Richard
0
Andy
Top achievements
Rank 1
answered on 18 Mar 2011, 05:38 PM
Perfect. Thanks a lot, Richard.

Andy
0
Richard Slade
Top achievements
Rank 2
answered on 18 Mar 2011, 05:40 PM
You're welcome Andy. Glad I could help
All the best
Richard
Tags
GridView
Asked by
Andy
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Andy
Top achievements
Rank 1
Share this question
or