Nested Grid Theme

8 posts, 0 answers
  1. Alep
    Alep avatar
    2 posts
    Member since:
    Apr 2009

    Posted 15 Jul 2010 Link to this post

    Hi Telerik,

    I have a nested grid and would like to apply different theme for each child grid. Is it possible to do such thing?
    For example:

    - the first grid uses Aqua theme
        - the 1st child grid uses Desert
            - the 2nd child uses Office 2010
              
    Another option is to have different color for each grid.

    Regards,

    Alep
  2. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 19 Jul 2010 Link to this post

    Hi Alep,

    Currently it is not possible to apply a different theme to the child views in RadGridView. In fact, you are the first to request this behavior. Yes, implementing this feature is possible, however it will be not easy, and we doubt that such feature will be user-friendly from usability and design perspective.

    You can still change the appearance of child rows by code. You should handle CellFormatting event for example and check whether ViewInfo.ParentRow is not null:

    void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
    {
        if (e.CellElement is GridDataCellElement && e.CellElement.ViewInfo.ParentRow != null)
        {
            e.CellElement.DrawFill = true;
            e.CellElement.GradientStyle = GradientStyles.Solid;
            e.CellElement.BackColor = Color.Lavender;
        }
    }

    Should you have any other questions, don't hesitate to ask.

    Kind regards,
    Jack
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Alep
    Alep avatar
    2 posts
    Member since:
    Apr 2009

    Posted 19 Jul 2010 Link to this post

    Thanks, that solved my problem.

    Another problem, Is it possible to expand one of the row programatically? also What event should I use if I want to loop through the grid rows after setting the data source?


    Regards,

    Alep
  4. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 20 Jul 2010 Link to this post

    Hi Alep,

    You can set the IsExpanded property of the row to expand it programmatically. Here is a sample:

    this.radGridView1.Rows[5].IsExpanded = true;

    After binding is complete the DataBindingComplete event fires. You can iterate rows in  this event. Please consider the sample below:

    void radGridView1_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e)
    {
        foreach (GridViewRowInfo row in this.radGridView1.Rows)
        {
            //..
        }
    }

    I hope this helps.

     

    Kind regards,
    Jack
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Brian
    Brian avatar
    4 posts
    Member since:
    Jan 2009

    Posted 31 Mar 2011 Link to this post

    I was looking for the same feature ( applying differing themes to nested grids ) - I have to disagree with the response to this question ->  "... and we doubt that such feature will be user-friendly from usability and design perspective. "  -- my thoughts are that when using multiple nested grids and they all have the same theme, it is actually difficult for users to easily notice the different grids. Having a different them for child grids would make them much easier to view.
    fwiw
    b stensrud
  6. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 04 Apr 2011 Link to this post

    Hello Brian,

    Thank you for your feedback. Currently, our theming system does not allow for using different styles for child views. This is not a trivial task and we do not have many requests to implement this feature. Nevertheless, we have it in our backlog and when more people request it, we will raise its priority.

    Still, you can customize that way child views look by handling the ViewCellFormatting event. Find more information in this help article and check the samples in our demo application.

    In case you have further questions, please feel free to write back.
     
    Greetings,
    Jack
    the Telerik team
  7. Fanie
    Fanie avatar
    7 posts
    Member since:
    Apr 2016

    Posted 29 Mar 2018 Link to this post

    I was also looking to change the theme of the child grids, is it still not available?
  8. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3008 posts

    Posted 02 Apr 2018 Link to this post

    Hello, Fanie,   

    By design, a certain theme can be applied to the entire control. Hence, you can't have one child template with one theme and another child template with another theme. The already suggested approach to use the ViewCellFormatting event is the appropriate way to customize the different templates according to your custom requirements. Additional information about this event is available in the following help article: https://docs.telerik.com/devtools/winforms/gridview/cells/formatting-cells

    I hope this information helps. If you have any additional questions, please let me know. 

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top