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

Help with getting rid of Child thick border

1 Answer 69 Views
GridView
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 13 May 2009, 10:14 AM
I am trying to develop a programatically defined hierarchical grid as the example pictured here: photohere

I want to get rid of the annoying thick orange border around the child grid, and also find a way so that the horizontal size of the child grid to be the same as the parent grid, and not extending to the right. I do not want to create a new style, but rather try to do it programmatically.

I have found a similar reference in the forum that supposedly takes care of the first problem, listed here:http://www.telerik.com/community/forums/winforms/gridview/hierarchy-child-size.aspx , but does not seem to do the trick, since the cell formating event never ends this loop.

Any help would be greatly appreciated.

Regards,

George





1 Answer, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 13 May 2009, 10:59 AM
Hi George,

Thank you for contacting us.

The code from our forum should be working. I am posting it here, to make sure you are using the right one:

void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e) 
    if (e.CellElement is GridDetailViewCellElement) 
    { 
        GridDetailViewCellElement cell = e.CellElement as GridDetailViewCellElement; 
        e.CellElement.Padding = new Padding(0); 
        e.CellElement.BorderWidth = 0;                 
    }  

If this doesn't solve the issue, please send us your application and we will try to find a proper solution.

You can't change the sizing algorithm for a child view. However, you could use a padding to achieve similar effect. Place this code inside ViewCellFormatting event:

e.CellElement.Padding = new Padding(0, 0, 100, 0); 
e.CellElement.DrawFill = false

If you have any further questions, don't hesitate to ask.

All the best,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
George
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or