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

[Solved] Grid bind not working

1 Answer 95 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.
Nishant
Top achievements
Rank 1
Nishant asked on 27 Oct 2010, 06:52 AM
Trying to bind the data from database to the grid.
it is not showing any error but not binding the data either.
Have used render method also.
please help.

i ve used below mentioned code in index.aspx

<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master"  Inherits="System.Web.Mvc.ViewPage<IEnumerable<MvcApplication1.Models.Emp>>" %>

 

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">

    Home Page

</asp:Content>

 

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2><%: ViewData["Message"] %></h2>

    <p>

        To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.

    </p>

<% Html.Telerik().ScriptRegistrar()

          .Render();

%>

 

 

 

 

    <%= Html.Telerik().Grid<MvcApplication1.Models.Emp>()

        .Name("EmpGrid")

                .Columns(columns =>

        {

            columns.Bound(o => o.Eid);

            columns.Bound(o => o.Ename);

            columns.Bound(o => o.MgrID);

           

        })

        .Pageable()

        .Sortable()

 %>

 

</asp:Content>

1 Answer, 1 is accepted

Sort by
0
Jigar
Top achievements
Rank 1
answered on 27 Oct 2010, 07:09 AM
Hi Nishant,

Please have a look on the demos.

This may help.

Regards,

Jigar.
Tags
Grid
Asked by
Nishant
Top achievements
Rank 1
Answers by
Jigar
Top achievements
Rank 1
Share this question
or