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

[Solved] grid grouping

0 Answers 33 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.
Michael
Top achievements
Rank 2
Michael asked on 04 Nov 2010, 10:44 AM
Hi all,

I'm new to this and for now just playing with grid and access database.
Here is code from Index.asp :

<%= Html.Telerik().Grid<System.Data.DataRow>(Model.Rows.Cast<System.Data.DataRow>())
    .Name("Grid")
    .Columns(columns =>
    {
        foreach (System.Data.DataColumn column in Model.Columns)
        {
            columns.Bound(column.DataType, column.ColumnName);
        }
    })
   .HtmlAttributes( new { style="height:500px"})
   .Scrollable(scrolling => scrolling.Height(410)) 
   .Pageable(paging => paging.PageSize(20))
   .Sortable()
   .Scrollable()
   .Groupable()
%>
<%= Html.Telerik().ScriptRegistrar() %>
And here is code from HomeController:
private DataTable Model()
        {
            OleDbConnection myCon = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\Nwind.mdb;Persist Security Info=False");
            DataSet myDS = new DataSet();
            OleDbCommand MyCmd = new OleDbCommand("SELECT * FROM Customers", myCon);
            OleDbDataAdapter myDA = new OleDbDataAdapter(MyCmd);
  
            myCon.Open();
            myDA.Fill(myDS, "Customers");
            return myDS.Tables["Customers"] ;
  
         }
 Question is how to add grouping in code?
Tags
Grid
Asked by
Michael
Top achievements
Rank 2
Share this question
or