Desperately need help with GrdiView styling in custom module

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.
4/19/2009 10:19:17 AM
Gravatar
Total Posts 64
Gerry Roston gerry (at) pairofdocs (dot) net

Desperately need help with GrdiView styling in custom module

All,

I cannot get a GridView in a custom module to accept formatting.

Here is a snippet from my .ascx file:

<%@ Control Language="VB" AutoEventWireup="true" ClassName="ACE_IBIPC.ascx" Inherits="System.Web.UI.UserControl" %>
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="mojoPortal.Business" %>
<%@ Import Namespace="mojoPortal.Business.WebHelpers" %>
<%@ Import Namespace="mojoPortal.Web.Framework" %>
<%@ Import Namespace="mojoPortal.Web.Controls" %>
<%@ Import Namespace="mojoPortal.Web.Editor" %>
<%@ Import Namespace="mojoPortal.Net" %>
<%@ Import Namespace="System.Data.Common" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<asp:Panel ID="pnlWrapper" runat="server">
   <asp:UpdatePanel ID="upGallery" runat="server" UpdateMode="Conditional">
     <ContentTemplate>
       <asp:Label ID="lblThankYou" runat="server" CssClass="moduletitle" Width="628px" Font-Bold="False"
         Text="Thank you for submitting your request to participate at ACE '10."></asp:Label>
       <asp:DetailsView ID="dvSignup" runat="server" DefaultMode="Insert" DataSourceID="sqlCompanies"
        DataKeyNames="SchoolID" AutoGenerateRows="False" CssClass="ace_signup">
         <Fields>
           <asp:TemplateField HeaderText="University" SortExpression="School">
             <InsertItemTemplate>
               <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("School") %>' Width="540px"></asp:TextBox>
             </InsertItemTemplate>
           </asp:TemplateField>
        </Fields>
     </asp:DetailsView>
     <div class="modulefooter"></div>
     </ContentTemplate>
   </asp:UpdatePanel>
</asp:Panel>

Here is a snippet from \Web\Data\Sites\1\skins\<style-sheet-being-used>

TABLE.ace_signup
{
   font-weight: bold;
   color: black;
   font-family: Sans-Serif;
   background-color: #ccffcc;
}
TABLE.ace_signup TR
{
   background-color: #550000;
}

Finally, here is how the page is rendering (taken from 'show page source')

<div id="ctl01_mainContent_ctl01_pnlWrapper">
   <div id="ctl01_mainContent_ctl01_upGallery">
     <div>
       <table cellspacing="0" cellpadding="0" align="Left" rules="rows" border="1" id="ctl01_mainContent_ctl01_dvSignup" style="border-width:1px;border-style:Solid;font-size:Small;font-weight:normal;font-style:normal;text-decoration:none;width:100%;border-collapse:collapse;">
           <tr align="left" valign="middle" style="border-width:0px;border-style:None;font-size:Small;font-weight:normal;font-style:normal;text-decoration:none;width:100%;">
            <td align="left" valign="bottom" style="border-width:1px;border-style:None;font-size:Small;font-weight:bold;font-style:normal;text-decoration:none;white-space:nowrap;">University</td>
 

As you can see, the CSS assigned to the GrdiView is no where to be seen and some other style is being applied. I am at a complete loss to figure out what is going on - please help! Note, however, the style applied to the Label control works just fine.

p.s. This is not browser related - the same problem occurs iwth both FF and IE. I also do not believe that it is cache related - I have set both CacheCssOnServer and CacheCssInBrowser to false.

Thank you.

4/19/2009 10:28:30 AM
Gravatar
Total Posts 18439

Re: Desperately need help with GrdiView styling in custom module

A few things to try.

First you are using a DetailsView not a GridView, maybe it should be a GridView?

Set EnableTheming to false on the Details/GridView and see if that makes the css class show up.

If not you could just wrap a div around the Details view with class="ace_signup", then change your css selectors to

.ace_signup table {}
.ace_signup tr {}

In Xhtml, always use lower case element names never upper case, so things in your CSS like TABLE.ace_signup should be table.ace_signup

Hope it helps,

Joe

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