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

No AutoSizeRows for child template?

1 Answer 77 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nancy
Top achievements
Rank 1
Nancy asked on 22 Sep 2011, 06:28 PM
There is a property for the main masterviewtemplate of a RadGridView to set the rows to auto size if you have a column's WordWrap turned on (i.e., this.radGridViewRequests.AutoSizeRows = true ).  This works slick.
BUT, for a child template there is no such property to AutoSizeRows if you have a column's WordWrap turned on.  So what is one supposed to do to get the child template rows to resize properly?

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 27 Sep 2011, 01:50 PM
Hello Nancy,

I will post the answer from your support ticket here, so the community can benefit from it:

The AutoSizeRows property affects all templates in RadGridView. So once you set it to true, you can set the WrapText property of any column in RadGridView and it will size itself accordingly. Alternatively, you can set your own size to rows by handling the CreateRow event. For example, here is how to set the non MasterTemplate cells size:
void radGridView1_CreateRow(object sender, GridViewCreateRowEventArgs e)
{
    if (e.RowInfo.ViewTemplate != radGridView1.MasterTemplate)
    {
        e.RowInfo.MinHeight = 40;
        e.RowInfo.MaxHeight = 40;
    }
}
 
All the best,
Stefan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Nancy
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or