Problems with SkinID in xGrid

Topics: Developer Forum
Apr 13, 2007 at 12:02 PM
Hi guys!!!

I'm trying to use xGrid in my Web Application and I'm trying to apply a SkinID:

App_Themes
|
-- MasterPageBase
|
-- MasterPageBase.css
-- MasterPageBase.skin

In web.config:

<pages styleSheetTheme="MasterPageBase">

In MasterPageBase.skin:

<asp:GridView SkinID="SampleGridView" Runat="server" CellPadding="2" Font-Size="8pt">
<HeaderStyle CssClass="" forecolor="#F7F6F3" backcolor="#5D7B9D" font-bold="True" />
<RowStyle forecolor="#333333" backcolor="White" />
<AlternatingRowStyle backcolor="#F7F6F3" />
<PagerStyle forecolor="#00FFFF" backcolor="#284775" />
</asp:GridView>

And in xGrid:

<cc2:xGrid ID="XGrid1" runat="server" AscImage="" SkinID="SampleGridView"

And the Warning Message:

A SkinID has specified but the page is not configured to use a page theme or stylesheet them. This is acceptable if the theme or stylesheet them will be set programmatically.

Why does this happen??? Is neccesary to use a special tag in skin file??? In the GridView this doesn't happen.

Thanks
Apr 13, 2007 at 8:10 PM
I think the problem is that in MasterPageBase.skin you have to put <asp:xGrid SkinID="SampleGridView" ...>. I have used skins with xGrid in my programs and it works fine.
I hope this helps!!!
Apr 14, 2007 at 10:04 AM
Sorry, put <cc2:xGrid...> instead of <asp:GridView...> in the file MasterPageBase.skin
Apr 16, 2007 at 7:43 AM
Thanks for your help Javier:

I had try to change de tag <asp:GridView...> in MasterPageBase.skin by this <cc2:xGrid and when I compile my solution:

Etiqueta de servidor 'cc2:xGrid' desconocida.

Thanks
Apr 17, 2007 at 5:39 AM
In my project, the file web.config has

<add tagPrefix="xGrid" namespace="CustomControls.Grid" assembly="CustomControls"/>

and the file Default.skin has

<xGrid:xGrid SkinID="Generic" runat="server" BackColor="White"
GridLines="None" ShowHeader="False" AutoGenerateColumns="False"
AscImage="" DescImage="" EnableHeightResolver="True" Width="100%"
MouseOverColor="Transparent" AllowPaging="true" PageSize="16">
</xGrid:xGrid>

and it works.

Is the tagPrefix cc2 defined in the web.config file or in the page in your project? I think this is important.