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

Nested Grid Theme

7 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alep
Top achievements
Rank 1
Alep asked on 16 Jul 2010, 04:43 AM
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

7 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 19 Jul 2010, 09:42 AM
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
0
Alep
Top achievements
Rank 1
answered on 19 Jul 2010, 11:25 AM
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
0
Jack
Telerik team
answered on 20 Jul 2010, 06:33 AM
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
0
Brian
Top achievements
Rank 1
answered on 01 Apr 2011, 02:25 AM
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
0
Jack
Telerik team
answered on 04 Apr 2011, 04:01 PM
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
0
Fanie
Top achievements
Rank 1
answered on 29 Mar 2018, 07:58 AM
I was also looking to change the theme of the child grids, is it still not available?
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Apr 2018, 11:48 AM
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.
Tags
GridView
Asked by
Alep
Top achievements
Rank 1
Answers by
Jack
Telerik team
Alep
Top achievements
Rank 1
Brian
Top achievements
Rank 1
Fanie
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or