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

Group and update multiple records into one gridview row

1 Answer 168 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 08 Aug 2013, 07:04 AM

I need to enhance the application and the table structure cannot be amend.

Table structure:

ID      StaffID     Type
========================
1       1           1
2       1           2  
3       1           3
4       2           2
5       2           3
6       3           1

 

 

I want to group same StaffID into one gridview row and then databind the checkbox (Type 1, Type 2, Type3) based on the value of "Type" column.

Proposed Gridview :

StaffID     StaffName   Type 1  Type 2  Type 3
==============================================
1           Amy         [X]     [X]     [X]
2           John        [ ]     [X]     [X]
3           Chris       [X]     [ ]     [ ]

Moreover, How can i insert/delete record if user check/uncheck the checkbox in gridview ?
Thanks.
 

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 12 Aug 2013, 10:20 AM
Hi Joe,

The RadGrid does not have build in functionality to edit and update tables in many-to-many relationship out of the box.
You will need to create manually a DataSource that has the data the same way as you want to show it inside the grid. Then you could handle manually the update command, and to update your tables with custom build queries.

See this demo of handling manually the CRUD operations with RadGrid:
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/programaticlinqupdates/defaultcs.aspx

Regards,
Vasil
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Joe
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or