I have a radgrid with hierarchy of one parent table and 3 detail tables all at the same level. When the user expands all 3 child levels at once, I set a caption to separate them. I would like to change the background color(where the caption is and around that). Not the grid background. Is there a way to change this color?
Also, is there a way to add a little space between the bottom of the last part of the child and the next parent record?
Thanks
Also, is there a way to add a little space between the bottom of the last part of the child and the next parent record?
Thanks
11 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 02 Dec 2008, 04:53 AM
Hi Laura,
Try the following code snippet to set the background color for the detail table Caption.
css:
Thanks
Shinu.
Try the following code snippet to set the background color for the detail table Caption.
css:
<head runat="server"> |
<title>Untitled Page</title> |
<style type="text/css" > |
.DetailTable_Default caption |
{ |
color: blue; |
background-color:red; |
} |
</style> |
</head> |
Thanks
Shinu.
0

Laura
Top achievements
Rank 1
answered on 02 Dec 2008, 03:59 PM
Thank you as always for your help. I tried to add this, and even added one for the mastertableview, but it does not use my styles. Here is the code I added:
<link rel="Stylesheet" href="..\..\styles.css" /> |
<style type="text/css"> |
.MasterTable_Default caption |
{ |
color: red; |
background-color: Blue !important; |
font-size: larger; |
} |
.DetailTable_Default caption |
{ |
color: blue; |
background-color: red !important; |
} |
html { overflow:scroll;} |
html, body, form {width:100%;height:100%; } |
</style> |
<telerik:GridTableView DataKeyNames="contact_id" DataSourceID="CCcontacts" Caption=" <h5><br>Details About Contacts</b> " |
Width="100%" runat="server" Name="Detail1" Font-Bold="False" CssClass="DetailTable_Default" |
Font-Italic="False" Font-Overline="False" Font-Strikeout="False" |
Font-Underline="False"> |
<telerik:GridTableView DataKeyNames="contact_id" DataSourceID="CCcontacts" Caption=" <h5><br>Details About Contacts</b> " |
Width="100%" runat="server" Name="Detail1" Font-Bold="False" CssClass="DetailTable_Default" |
Font-Italic="False" Font-Overline="False" Font-Strikeout="False" |
Font-Underline="False"> |
0

Shinu
Top achievements
Rank 2
answered on 03 Dec 2008, 03:46 AM
Hi Laura,
Which Skin you are using? You must apply the Skin name for the Grid in the style.
Caption Property
Thanks
Shinu
Which Skin you are using? You must apply the Skin name for the Grid in the style.
<head runat="server"> |
<title>Untitled Page</title> |
<style type="text/css" > |
.DetailTable_[SkinName] caption |
{ |
color: blue; |
background-color:red; |
} |
</style> |
</head> |
Caption Property
Thanks
Shinu
0

Laura
Top achievements
Rank 1
answered on 03 Dec 2008, 02:56 PM
Thank you Shinu. The word "default" through me off and I didn't realize that it was a skin name. I put the skin name in and that did the trick. One more question. That colors the caption area. The detail grids are indented a bit in to the right and there is whitespace that is connected to the caption area. Any way to set the color of that left margin area next to the deatail tables?
Thanks,
Laura
Thanks,
Laura
0

Princy
Top achievements
Rank 2
answered on 04 Dec 2008, 11:51 AM
Hi,
You can achieve this scenario by hiding the expand/collapse images, and hiding the remaining cells. This is demonstrated in the link below:
http://www.telerik.com/community/forums/aspnet/grid/master-detail-formatting.aspx
I hope this information helps.
Thanks,
Princy
You can achieve this scenario by hiding the expand/collapse images, and hiding the remaining cells. This is demonstrated in the link below:
http://www.telerik.com/community/forums/aspnet/grid/master-detail-formatting.aspx
I hope this information helps.
Thanks,
Princy
0

Laura
Top achievements
Rank 1
answered on 04 Dec 2008, 01:38 PM
Princy, it appears that the suggestion you give is to get rid of the indent of the detail tables. I do not want to get rid of the indent, but I want to make the color of the indented area match the color of the caption area. Is this possible? Thanks
0

Larry
Top achievements
Rank 2
answered on 07 Feb 2009, 07:36 AM
Disregard.
0

Larry
Top achievements
Rank 2
answered on 07 Feb 2009, 09:12 AM
Is there a way to change the caption around a MasterTableView, DetailTableView, DetailTableView. In other words, the 3rd level of a hierarchical grid. I tried creating css for DetailTable_DetailTable_Outlook, but that did not work.
0
Hi Larry,
In case you need to address detail tables, which are inside detail tables, you need this CSS selector:
.DetailTable_Outlook .DetailTable_Outlook
{
/*.....*/
}
Regards,
Dimo
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
In case you need to address detail tables, which are inside detail tables, you need this CSS selector:
.DetailTable_Outlook .DetailTable_Outlook
{
/*.....*/
}
Regards,
Dimo
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

The Wire
Top achievements
Rank 1
answered on 16 Feb 2011, 04:04 PM
Nothing like resurrecting a really old thread ;)
Anyway, I was looking for a similar way to color the left margin area where the detail tables are indented in. I have two detail tables, the first one has 100% width so there's no indention there, but the second is fixed layout and right aligned in the detail table area, so I have a large indented space to the left of my second detail table. To color that area, I set the BackColor of the RadGrid control to be the desired color, and then I did BackColor overrides for each ItemStyle/AlternatingItemStyle of the MasterTableView and my two detail tables. This colored the indented space but left all the other BackColors how I assigned them.
For simplicity, I removed alot of the other stuff (attributes,columns,etc) but many of the things I removed are still necessary for the RadGrid control to function properly.
Anyway, I was looking for a similar way to color the left margin area where the detail tables are indented in. I have two detail tables, the first one has 100% width so there's no indention there, but the second is fixed layout and right aligned in the detail table area, so I have a large indented space to the left of my second detail table. To color that area, I set the BackColor of the RadGrid control to be the desired color, and then I did BackColor overrides for each ItemStyle/AlternatingItemStyle of the MasterTableView and my two detail tables. This colored the indented space but left all the other BackColors how I assigned them.
For simplicity, I removed alot of the other stuff (attributes,columns,etc) but many of the things I removed are still necessary for the RadGrid control to function properly.
<
rad:RadGrid
Width
=
"100%"
BackColor
=
"LightGray"
>
<
ItemStyle
BackColor
=
"White"
/>
<
AlternatingItemStyle
BackColor
=
"White"
/>
<
MasterTableView
...>
<
Columns
>
...
</
Columns
>
<
DetailTables
>
<
rad:GridTableView
Width
=
"100%"
>
<
ItemStyle
BackColor
=
"White"
/>
<
AlternatingItemStyle
BackColor
=
"White"
/>
<
Columns
>
...
</
Columns
>
</
rad:GridTableView
>
<
rad:GridTableView
TableLayout
=
"Fixed"
HorizontalAlign
=
"Right"
>
<
ItemStyle
BackColor
=
"White"
/>
<
AlternatingItemStyle
BackColor
=
"White"
/>
<
Columns
>
...
</
Columns
>
</
rad:GridTableView
>
</
DetailTables
>
</
MasterTableView
>
</
rad:RadGrid
>
0
Hi Nathan,
The following code library entry shows how to apply a custom CSS class to the table cells, which contain the RadGrid detail tables:
http://www.telerik.com/community/code-library/aspnet-ajax/grid/how-to-obtain-reference-to-radgrid-detailtables-containing-rows-and-cells-and-customize-their-appearance.aspx
After doing this, you can set styles of your preference to these cells.
In addition, RadGrid now applies a rgExpandCol class to the table cells from the GridExpandColumn, which push the detail tables to the right.
Best wishes,
Dimo
the Telerik team
The following code library entry shows how to apply a custom CSS class to the table cells, which contain the RadGrid detail tables:
http://www.telerik.com/community/code-library/aspnet-ajax/grid/how-to-obtain-reference-to-radgrid-detailtables-containing-rows-and-cells-and-customize-their-appearance.aspx
After doing this, you can set styles of your preference to these cells.
In addition, RadGrid now applies a rgExpandCol class to the table cells from the GridExpandColumn, which push the detail tables to the right.
Best wishes,
Dimo
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.