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

heirarchy grid

2 Answers 111 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Atefeh
Top achievements
Rank 1
Atefeh asked on 28 May 2012, 12:39 PM

Hi
I used from Hierarchy grid.how can i resize width of child grid .
i can resize height of cells of child grid with this code

void radGridView1_ChildViewExpanded(object sender, ChildViewExpandedEventArgs e)
{
    e.ChildRow.Height = 300;
}

but cant change width of child grid.In normal width of child grid is same with parent grid

2 Answers, 1 is accepted

Sort by
0
Boryana
Telerik team
answered on 31 May 2012, 01:20 PM
Hello Atefeh,

Thank you for contacting us.

As far as I understand, you would like to change the width of the child row, so that its blue frame matches the width of the parent row. If this is the case, please try the following approach:
private void radGridView1_ViewRowFormatting(object sender, Telerik.WinControls.UI.RowFormattingEventArgs e)
{
    if (e.RowElement is GridDetailViewRowElement)
    {
        int width = this.radGridView1.TableElement.VisualRows[0].Size.Width;
        e.RowElement.MaxSize = new Size(width, 0);
    }
}

If your requirement differs from my guess, please provide a screenshot of the layout you would like to achieve.

All the best,
Boryana
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
Atefeh
Top achievements
Rank 1
answered on 01 Jun 2012, 09:22 AM
Thank 's a lot Boryana  for your help
Tags
GridView
Asked by
Atefeh
Top achievements
Rank 1
Answers by
Boryana
Telerik team
Atefeh
Top achievements
Rank 1
Share this question
or