Unable to get horizontal scroll bar on child grid

5 posts, 0 answers
  1. MICHAEL
    MICHAEL avatar
    3 posts
    Member since:
    May 2012

    Posted 06 Dec 2013 Link to this post

    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.
  2. George
    Admin
    George avatar
    500 posts

    Posted 09 Dec 2013 Link to this post

    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 >>
  3. MICHAEL
    MICHAEL avatar
    3 posts
    Member since:
    May 2012

    Posted 09 Dec 2013 Link to this post

    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.
  4. MICHAEL
    MICHAEL avatar
    3 posts
    Member since:
    May 2012

    Posted 11 Dec 2013 Link to this post

    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.
  5. George
    Admin
    George avatar
    500 posts

    Posted 12 Dec 2013 Link to this post

    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 >>
Back to Top