This is a migrated thread and some comments may be shown as answers.

[Solved] Displaying "No Record Found" message if child list is null

0 Answers 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Venkitachalam
Top achievements
Rank 1
Venkitachalam asked on 28 Oct 2010, 11:49 AM
Hi,

I have used Server Hierarchy of grid.
In that, I have displayed "No Record Found" message instead of empty grid if child list is null.
Code is as follows:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="MvcApplication3.Views.Home.HierarchyServer" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    HierarchyServer
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        HierarchyServer</h2>
    <%Html.Telerik().Grid(Model)
        .Name("Grid")
        .DetailView(detailView => detailView.Template(e =>
                            {
                            if (e.dept != null)
                            {
                            %>
                            <%
                                Html.Telerik().Grid(e.dept)
                                    .Name("Child_" + e.empid)
                                    .Render();
                            }
                            else
                            {
                            %>
                            <div>
                                No Record Found</div>
                            <%
                            }
                            }))
        .Render();%>
</asp:Content>

Please see attached image for the given view.

Now I want to do this by using Ajax Hierarchy of grid.
Is it possible?
If yes please tell me how is it possible?

Thanks & Regards,
Chandran
Tags
Grid
Asked by
Venkitachalam
Top achievements
Rank 1
Share this question
or