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

Unable to get horizontal scroll bar on child grid

4 Answers 199 Views
GridView
This is a migrated thread and some comments may be shown as answers.
MICHAEL
Top achievements
Rank 1
MICHAEL asked on 06 Dec 2013, 07:03 PM
Apologies if this has been covered, but I have exhausted Google searches on this one.

I have a grid with 5 child grids.  One of the child grids does proper horizontal scrolling so the user can see all columns with their widths set as they were at designtime.  However, the other 4 would try to mash all coluns together to fit, and then upon changing the size of said columns, it would only show what would fit.

Examining all the properties of the 5 templates, I really don't see anything different that would cause this.  I even set HorizontalScrollState to AlwaysShow and still no scrollbar.

Also, I need to know how to change the height of the child grid as well.  This could be the problem, maybe the scroll bar is there just not visible?

Thanks.

4 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 09 Dec 2013, 03:25 PM
Hello Michael,

Thank you for contacting us.

You can try to set the UseScrollbarsInHierarchy property of RadGridView to true, this should explicitly allow scrollbars inside child templates.

You can also try to set the Height of the child rows using the following code:
void grid_RowFormatting(object sender, RowFormattingEventArgs e)
{
    GridViewHierarchyRowInfo hierarchyRow = e.RowElement.RowInfo as GridViewHierarchyRowInfo;
    if (hierarchyRow != null && hierarchyRow.ChildRow != null)
    {
        int customHeight = 150;
 
        hierarchyRow.ChildRow.MaxHeight = customHeight;
        hierarchyRow.ChildRow.Height = customHeight;
    }
}

I hope this will help.

Regards,
George
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
MICHAEL
Top achievements
Rank 1
answered on 09 Dec 2013, 08:24 PM
Adding this code made no change at all.  I verified the events are being hit.  I also changed customHeight to various numbers with no results.

UseScrollbarsInHierarchy is set to true on the main grid. 

Again, I don't know why the scroll bars aren't showing, or how to change the height of each child grid... not the row, but the entire grid area.
0
MICHAEL
Top achievements
Rank 1
answered on 11 Dec 2013, 09:09 PM
Figured it out on my own. 
The problem was the templates that didn't have scroll bars had AutoSizeColumnsMode = Fill. 
Setting this to None makes the scroll bars suddenly appear.
0
George
Telerik team
answered on 12 Dec 2013, 09:27 AM
Hi Michael,

I am glad that you were able to resolve the issue yourself.

Do not hesitate to contact us, should you have any further questions.

Regards,
George
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
MICHAEL
Top achievements
Rank 1
Answers by
George
Telerik team
MICHAEL
Top achievements
Rank 1
Share this question
or