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

GridTableView and HeaderStyle

1 Answer 369 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris Haas
Top achievements
Rank 1
Chris Haas asked on 26 Apr 2011, 05:26 AM
Hello Telerik Folks,

I'm using a Telerik Grid with a Master/Detail setup.  Everything works great except if I set any property of the HeaderStyle on the Child detail GridTableView, it does not render the "rgHeader" base class in the <th> of the column headers.  Without rgHeader, I loose the nice background image and colors I have set in my Skin.  This does not happen when I set the same properties on the Master table.

My workaround is to create a Css class with all the settings I need and set the HeaderStyle-CssClass="rgHeader myClassName".  This is not ideal as the next guy in my company may not figure this out.

I can't imagine this is the desired functionality.  I was using the Q1 2010 version of Telerik.Web.UI and then upgraded to the latest version "2011.1.413.40" but still got the same result.  Please advise.

Thanks,
Chris

1 Answer, 1 is accepted

Sort by
0
Galin
Telerik team
answered on 28 Apr 2011, 02:21 PM
Hi Chris Haas,

If you set CssClass to the HeaderStyle outside the MasterTableView, the RadGrid Control will add it to all headers, e.g.:
Copy Code
<telerik:RadGrid ID="RadGrid1" runat="server" ...>
    <HeaderStyle CssClass="yourClassName" />
    <MasterTableView>
        <Columns>
              .......
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

On the other hand if you set CssClass inside the column markup, this will replace the class of header for this column. This is done so it is possible to easily clear a default setting for specific column. If you want to keep the default styles, just set CssClass="rgHeader yourClassName", e.g.:
Copy Code
<telerik:RadGrid ID="RadGrid1" runat="server" ...>
    <MasterTableView>
        <Columns>
            <telerik:GridTemplateColumn>
                <HeaderStyle CssClass="rgHeader yourClassName" />
                ......               
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Additionally, to avoid duplicate posts, please refer to the support ticket. We can continue our communication there.

Greetings,
Galin
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.

Tags
Grid
Asked by
Chris Haas
Top achievements
Rank 1
Answers by
Galin
Telerik team
Share this question
or