GridViewAdapter ignoring EmptyDataTemplate

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/30/2011 1:19:25 AM
Gravatar
Total Posts 9

GridViewAdapter ignoring EmptyDataTemplate

Hi everybody,

This is my first post, so I'd just like to say hi to everyone and that after working with it for a couple of months, I've found mojoPortal to be quite impressive. Well done Joe and everybody else!

I've been using mojoGridView and I've noticed that the GridViewAdapter isn't handling EmptyDataText or EmptyDataTemplate.

For example, the EmptyDataTemplate below is not rendered when the grid (ID="MyGridView") is bound to a data source that does not contain any records.

<mp:mojoGridView ID="MyGridView" runat="server" AutoGenerateColumns="False">
    <Columns>
        <asp:TemplateField HeaderText="My Id">
            <ItemTemplate>
                <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <EmptyDataTemplate>
        <p>I'm empty</p>
    </EmptyDataTemplate>
</mp:mojoGridView>

A small modification to Web\Controls\Adapters\GridViewAdapter.cs, based on Abu Emesh post at http://stackoverflow.com/questions/3856890/gridview-using-css-friendly-control-adapters-removes-emptydatatemplate-and-empt was all it took to get it to work.

I just wanted to share this in case it was useful to someone else. Maybe it's worth making the change in the main code branch.

Regards,

Jonas

3/30/2011 11:59:07 AM
Gravatar
Total Posts 18439

Re: GridViewAdapter ignoring EmptyDataTemplate

Hi Jonas,

Thanks! I will make this change in our GridViewAdapter.

Best,

Joe

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