We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

No se muestra el grid

Buenos dias.
Tengo un aspx, en la cual quiero mostrar un listado simple, sin paginación. 
Para ello me traigo en un List<TModel>, un cantidad de unos mil registros, y lo asocio a un Grid, pero el Grid no se muestra. adjunto codigo fuente 
aspx.
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<br /><br />
<div id="wrapper">
    <p>Antes del listado</p>
      <div class="wrapper_tabla">
          <ej:Grid ID="FlatGrid" runat="server" AllowSorting="True" AllowPaging="false" Visible ="true" >
           <Columns>
                <ej:Column Field="Nombre" HeaderText="Nombre"   TextAlign="Right" Width="150" Visible="true"/>
                <ej:Column Field="Descripcion" HeaderText="Descripción" Width="250"  Visible ="true" />                
           </Columns>
         </ej:Grid>
     </div>
    <br /><br />

    <p>fin</p>
</div> 
</asp:Content>

CodeBehind
  List<Models> modelos= new List<Models>();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Usuario"] == null)
                Response.Redirect("~/Login.aspx");
            else
            {
                BindDataSource(); 
            }
         
           
        }



        private void BindDataSource()
        {
            clsModelos m = new clsModelos();

            m.ListarModelos();
            try
            {

                for (int i = 0; i < m.listModelos.Count; i++)
                {
                    modelos.Add(new Models(m.listModelos[i].Nombre ,m.listModelos[i].Descripcion ));
                    
                }

                this.FlatGrid.DataSource = modelos;
                this.FlatGrid.
                this.FlatGrid.DataBind();
            }
            catch (Exception err)
            { 
            }
            
         
         
        }

        [Serializable]
        public class Models
        {
            public Models()
            {

            }
            public Models(string nombre, string descripcion)
            {
                this.Nombre = nombre;
                this.Descripcion= descripcion;
            }
            public string Nombre { get; set; }
            public string Descripcion { get; set; }
        }
Muchas Gracias 
Un saludo
Martín Gonzalez-.

3 Replies

GV Gowthami V Syncfusion Team April 14, 2015 10:03 AM UTC

Hi Martin,

We have analyzed the reported issue and the code snippets that you have shared with us. We suspect that you would have missed out to refer the scripts and css files in your project.

The scripts and the css files can be found in the following location.

CSS Location: C:\Program Files (x86)\Syncfusion\Essential Studio\13.1.0.21\JavaScript\assets\css\web

Script Location: C:\Program Files (x86)\Syncfusion\Essential Studio\13.1.0.21\JavaScript\assets\scripts\web

Please refer the below Online Documentation link for creating a sample in ASP manually.

Online Documentation link: http://help.syncfusion.com/ug/js/default.htm#!documents/createmanually1.htm
For your convenience we have created a simple sample binding 2000 records to grid and displaying the grid without paging. The sample can be downloaded from the below location.

Sample Link: Sample.zip

Please try the above sample and if you are still facing the issue, then please get back to us with more information such as any script error thrown or reproduce the issue in the above sample if possible.

Regards
Gowthami V.



MA Manolo April 15, 2015 07:45 AM UTC



GV Gowthami V Syncfusion Team April 16, 2015 03:22 PM UTC

Hi Martin,
We deeply regret for the inconvenience caused.

We have fixed the issue. The page is working fine now.

http://help.syncfusion.com/ug/js/index.html#!Documents/createmanually1.htm
Please let us know if you have any concerns.
Regards,
Gowthami V.

Loader.
Up arrow icon