Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
140
Model usage when constructing grid
posted

Hi,

 

What is the model using for when constructing grid?  I have created two grids with different model but same code excepted model.  It works same.

@Html.Infragistics().Grid<Model1>

 

@Html.Infragistics().Grid<Model2>

Thanks

Wilson

  • 19693
    Suggested Answer
    posted

    Hello Wilson,

    Thank you for posting in our community.

    The Model1 and Model2 used in this context are the model types that will be used when constructing the grid.

    For example in the code snippet below Customer is the class that will be passed in the template and it can be used later when creating the columns in chaining and etc. 

    @(Html.Infragistics().Grid<Infragistics.Web.Mvc.Samples.Models.Customer>(Model) 

     ...

    public class Customer

        {

            public int CustomerID { get; set; }

            public string CustomerName { get; set; }     

            public List<Order> Orders { get; set; }

        }

    …..

       .Columns(column =>

            {

                column.For(x => x.CustomerID).HeaderText(“CustomerID”);

            })

    More examples how this is used you can find in the online samples and the help documentation

    http://igniteui.com/grid/datatable-binding

    http://help.infragistics.com/Help/Doc/jQuery/2013.2/CLR4.0/html/igHierarchicalGrid_Binding_to_DataSet.html#_Toc335726982

    Please let me know if you need further assistance regarding this.