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

Hierarchy GridView Header Style Error

3 Answers 38 Views
GridView
This is a migrated thread and some comments may be shown as answers.
SchaF
Top achievements
Rank 1
SchaF asked on 05 Nov 2012, 04:42 PM
I have a girdview that has a child gridview within it for displaying information retaining to 1 single row in the parent gridview. My problem is that after data is loaded into the gridview, the newly added "+" column to expand the "sub rows" in the child gridview and the 1 column within the child gridview are both not retaining the header or cell styling like the rest of the table. Any ideas, my image is attached to visually see my problem.

Also, how can color the child gridviews rows so they match the cell background? How can I auto size the columns so they will all fill out the width of the child grid view?

How can I change the first column of both the parent and child so the header is not black but matches the other columns header styles? How can I remove the ">" from the first row of the child gridview for each row in the table?

3 Answers, 1 is accepted

Sort by
0
SchaF
Top achievements
Rank 1
answered on 07 Nov 2012, 06:53 PM
Does anyone know why when my grid adds the "+" sign to show the sub rows, the style is not the same? Is there some setting I need to set so it will do that. Ive got styles selected for the HeaderRow and Cell Style and both are messing up.
0
Yoan
Telerik team
answered on 08 Nov 2012, 02:10 PM
Hello Brandon,

I suppose that you are using CellStyle and this is why the row does not have applied the style. If you want to  style the GridView's row you can create implicit style targeting GridViewRow:

<Style TargetType="telerik:GridViewRow">
 <Setter Property="Background" Value="Red"/>
</Style>

I suggest you to check this help article, where you can find information about how you can change the visual appearance of the RadGridView and its elements. 

To learn how to style Silverlight RadControls read the common topics about Styling and Appearance . If you are new to the controls they will give you the basic knowledge about it.

Check this help article in order to get familiar with main visual elements of the standard RadGridView control. As you can see from this help article, the ">" is actually RowIndicator and you are able to set its Visibility.


About your problem with the columns' width, please check this troubleshooting guide.


Regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
SchaF
Top achievements
Rank 1
answered on 08 Nov 2012, 06:21 PM
Ive tried setting the width of the column in the nested/child gridview to "*", however when I do that, it sets each column to like 1000 pixels wide and I have to scroll a bunch to see the data. I want it to be the width of what the parent gridview is, but its not doing that. So I just set the child gridviews max width to a little smaller than the parent gridview (the page doesnt resize), and then set the 3rd columns with to "*" and its looking good now.

I will look into styling a grid with the stuff you posted but Im in expression 4 and my options dont look like whats given in those pages.
Tags
GridView
Asked by
SchaF
Top achievements
Rank 1
Answers by
SchaF
Top achievements
Rank 1
Yoan
Telerik team
Share this question
or