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

grid css

3 Answers 135 Views
Grid
This is a migrated thread and some comments may be shown as answers.
newbie
Top achievements
Rank 1
newbie asked on 06 Mar 2009, 12:45 AM
I have a nestedview template inside my grid.

Inside the nestedViewtemplate I have a grid.
I want to change the row color for the inner grid. Which property should I refer to?
I was able to change the headerstyle-backcolor by specifying this property in the grid declaration but using ItemStyle-backcolor I am not able to change the background color for the rows.
I am using themes in my application.

Can you suggest?

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Mar 2009, 05:59 AM
Hi Newbie,

I created a SkinFile and set the back color for  the row in the SkinFile . I applied the theme along with Skin in my application and it is working fine as expected. The Back Color is getting applied for both master Grid and nested Grid.  Here is what I have tried:

SkinFile:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
  <telerik:RadGrid ItemStyle-BackColor="red" AlternatingItemStyle-BackColor="Pink"     PageSize="3" Width="1000px" runat="server"  GridLines="None" > 
  </telerik:RadGrid> 


ASPX:
<%@ Page Language="C#" AutoEventWireup="true" Theme="SkinFile"  CodeFile="Default4.aspx.cs" Inherits="Default4" %> 
.... 
 ... 
 
      <telerik:RadGrid ID="RadGrid1"  Skin="Hay" OnNeedDataSource="RadGrid1_NeedDataSource" AllowSorting="true"   DataSourceID="SqlDataSource1"   runat="server"   > 
            <MasterTableView AutoGenerateColumns="true" AllowNaturalSort="false" AllowFilteringByColumn="true"   DataKeyNames="ProductID"  CommandItemDisplay="top" NoMasterRecordsText="No records to display"   ShowFooter="true" > 
            <NestedViewTemplate> 
                <telerik:RadGrid ID="RadGrid3" DataSourceID="SqlDataSource2"   AutoGenerateColumns="true" runat="server"
                </telerik:RadGrid> 
            </NestedViewTemplate> 
           </MasterTableView> 
         
        </telerik:RadGrid> 


Thanks
Shinu


0
newbie
Top achievements
Rank 1
answered on 06 Mar 2009, 06:46 PM
I already have a skin applied to my controls.
If i create another skin file and apply to the sub grids then it doesn't take any of the original skin file changes.

I just want to be able to change the row color for the grid that is inside the nestedviewtemplate.
Why am i not able to apply ItemStyle-Backcolor directly to the grid just like the  HeaderStyle-BackColor?

 

I don't want to change the row color for the master grid.


0
Dimo
Telerik team
answered on 07 Mar 2009, 12:44 PM
Hello newbie,

Make sure that there are no CSS styles or theme settings, which force an unexpected background to the inner RadGrid row background.

If you still have troubles, please open a support ticket and send a sample project, so that we can see what's going on exactly.

Regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
newbie
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
newbie
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or