Column widths using mojoGridView

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.
3/15/2014 2:17:57 PM
Gravatar
Total Posts 111
Matt Millican InternetMill

Column widths using mojoGridView

I've noticed that the column widths I'm setting in markup for columns of a mojoGridView aren't being used.  I usually do something like this:

<asp:TemplateField HeaderText="Device" ItemStyle-Width="20%">
    <ItemTemplate>
        <asp:Label runat="server" ID="lblDeviceName"/>
    </ItemTemplate>
  </asp:TemplateField>

Has anyone seen this or know a way around it?

Thanks!
Matt

3/17/2014 2:22:48 PM
Gravatar
Total Posts 18439

Re: Column widths using mojoGridView

Hi Matt,

mojoGridView uses the CSS Adapters which does away with inline styles such as those Item-Style- settings would create as it says on this page.

If you want that inline style stuff to work then you should just use <asp:GridView instead of mojoGridView. The whole purpose of the adapter is to get away from that inline style and have cleaner markup.

Hope that helps,

Joe

3/17/2014 2:47:57 PM
Gravatar
Total Posts 111
Matt Millican InternetMill

Re: Column widths using mojoGridView

Thanks Joe!

That's what I was suspecting.  Do you have any tricks then to get the styling to work for the asp:GridView?  Or better yet, be able to set the column widths while still using the mojoGridView?

Thanks again,
Matt

3/17/2014 7:53:16 PM
Gravatar
Total Posts 111
Matt Millican InternetMill

Re: Column widths using mojoGridView

It looks like ItemStyle-CssClass on the fields/columns will apply the given CSS class, so that should work!

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