or

public class ContactModel { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string GenderCode { get; set; } public DateTime BirthDate { get; set; } public AddressModel Address { get; set; } public string Email { get; set; } public string Phone { get; set; } public decimal DesiredSalary { get; set; } }[AcceptVerbs(HttpVerbs.Post)] public ActionResult _UpdateGridData([DataSourceRequest] DataSourceRequest request, [Bind(Prefix="models")]IEnumerable<Models.ContactModel> models) { if (models != null && ModelState.IsValid) { foreach (var contact in models) { var target = model.Values.Where(x => x.Id == contact.Id).FirstOrDefault(); if (target != null) { target.LastName = contact.LastName; target.FirstName = contact.FirstName; target.BirthDate = contact.BirthDate; target.GenderCode = contact.GenderCode; } } } return Json(ModelState.ToDataSourceResult()); }// Create a Datasource.var gridDataSource = new kendo.data.DataSource({ dataType: "json", data: "Data", transport: { read: { url: '@Url.Action("_GetGridData", "KendoGrid")', dataType: "json" }, update: { url: '@Url.Action("_UpdateGridData", "KendoGrid")', dataType: "json", type: "POST" } }, pageSize: 10, batch: true, schema: { model: { id: "Id", fields: { Id: { type: "number", editable: false, nullable: true }, FirstName: { type: "string", validation: { required: true } }, LastName: { type: "string", validation: { required: true } }, GenderCode: { type: "string", nullable: true }, BirthDate: { type: "date" } } } }});// Create a Grid using the above data source.$("#inlinekendogrid").kendoGrid({ columns: [ { field: "Id", title: "ID", width: 8, filterable: false, editable: false }, { field: "FirstName", title: "First Name", width: 25 }, { field: "LastName", title: "Last Name", width: 25 }, { field: "GenderCode", title: "Gender", width: 25 }, { field: "BirthDate", title: "Born", width: 25, format: "{0:MM/dd/yyyy}" } ], editable: { create: true, update: true, destroy: true, confirmation: "Are you sure you wish to remove this entry?" }, dataSource: gridDataSource, sortable: { mode: "multiple" }, pageable: { refresh: true, pageSizes: true }, selectable: true, navigatable: true, filterable: true});models[0][Id]:2models[0][FirstName]:Sallymodels[0][LastName]:Shoreman22models[0][GenderCode]:Fmodels[0][BirthDate]:Mon Sep 20 2010 00:00:00 GMT-0700 (Pacific Daylight Time)models[0][Address][AddressLine1]:2 Way Streetmodels[0][Address][AddressLine2]:models[0][Address][AddressLine3]:models[0][Address][City]:Salemmodels[0][Address][State]:ORmodels[0][Address][ZipCode]:97312models[0][Email]:salshor@saif.commodels[0][Phone]:models[0][DesiredSalary]:0
How to make Gridview control to group in each column of data?
Hi, I have a web project which uses webform with Gridview to display the SQL server table data,
Data in Gridview Control is as this grid format:
Data 1 | Data 2 | Data 3 Amount1 Amount2 Amount3
Data 1 | Data 2 | Data3 Amount1 Amount2 Amount3
Data 1 | Data 2 | Data 3 Amount1 Amount2 Amount3
Data 1 | Data 2 | Data 3 Amount1 Amount2 Amount3
Ground Total: Gtotal1 Gtotal2 Gtotal3
I expact the data to be shown in the report in this way:
+Data1 Subtotal1 Subtotal2 Subtotal3
Ground total Gtotal1 Gtotal2 Gtotal2
Click +Data1 to expand it, it should be:
-Data1 Subtotal1 Subtotal2 Subtotal3
+Data2 SecondSubtotal1 SecondSubtotal2 SecondSubtotal3
Gtotal1 Gtotal2 Gtotal3
Click +Data2 to expand it, it should be:
-Data1 Subtotal1 Subtotal2 Subtotal3
-Data2 SecondSubtotal1 SecondSubtotal2 SecondSubtotal3
+Data3 ThirdSubtotal1 ThirdSubtotal2 ThirdSubtotal3
Gtotal1 Gtotal2 Gtotal3
Click +Data3 to expand it, it should be:
-Data1 Subtotal1 Subtotal2 Subtotal3
-Data2 SecondSubtotal1 SecondSubtotal2 SecondSubtotal3
-Data3 ThirdSubtotal1 ThirdSubtotal2 ThirdSubtotal3
DetailsAmt1 DetailsAmt2 DetailsAmt3
Ground Total Gtotal1 Gtotal2 Gtotal3
Of cause, the + and - sign in the report will be able to expand and collapse.
After did some search from the internet, somebody mention Jqgrid, or telirik tool, etc. but most of them are only works on first level of group, not more than one group, I appricate anybody can provide any solution to achieve this goal. Some examples will be helpful