Problem with GridView in custom UserControl

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
2/3/2010 8:10:18 AM
Gravatar
Total Posts 9

Problem with GridView in custom UserControl

I need to extend nojoPortal to support our custom Catalog.  So, after reading the great documentation, I was able to create a custom Module, add it to the site using the admin/Advanced Tools menu, and get my control to show up - great.

My control has a GridView in it.  The GridView is connected to a SQLDataSource, and it does display data from the database - again, that's great.  But, if I style the Gridview with header colors and alternate row colors, these settings aren't displayed when the control is viewed from the browser.  All I see is a very basic black and white grid, with my data from the database.  But the style info is not changing the look of the GridView.

If I take my control and make it into a stand-alone page, the header colors and alternate row colors are displayed.  This is not a stylesheet issue because the GridView isn't using a stylesheet, the values are hard coded into it.  What is causing mojoPortal to strip out the style from a GridView?

Thanks for a great product,
Jim

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
CellPadding="4" ForeColor="#333333" GridLines="None">
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:BoundField DataField="seq" HeaderText="seq" InsertVisible="False" ReadOnly="True" SortExpression="seq" />
<asp:BoundField DataField="PartNumber" HeaderText="PartNumber" SortExpression="PartNumber" />
<asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>

2/3/2010 8:31:23 AM
Gravatar
Total Posts 18439

Re: Problem with GridView in custom UserControl

Hi Jim,

Probably you need to set EnableTheming="false" on your GridView.

Alternatively, you could also use <mp:mojoGridView and then you would have some styles that match other grids in mojoportal.

Hope it helps,

Joe

2/3/2010 8:38:02 AM
Gravatar
Total Posts 9

Re: Problem with GridView in custom UserControl

Setting EnableTheming="false" worked.   I didn't know about that property.

Thanks - Jim

You must sign in to post in the forums. This thread is closed to new posts.