I want to display data using web grid in MVC
I want to display data like this. based on the names repeat in the database the date column split into that no of columns .can any one please tell me.Its very important please guide me
| Name | Date | |||
| Sai |
| |||
| Srujana |
| |||
| Syam |
|

Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Jul 14, 2014, 11:35 PM EDT
srujana thallam67 reputationPosted Jul 14, 2014, 11:39 PM EDT
sample data
Name date
---------------------------------
Srujana 15/7/2014
sai 11/5/2014
srujana 22/3/2014
srujana 12/4/2013
sai 30/9/2014
syam 20/8/2012
I want display name one time and the split the date column based on the no.of repetation of name in data.
srujana thallam67 reputationPosted Jul 15, 2014, 1:06 AM EDT
I am using DB2 database
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Jul 15, 2014, 1:48 AM EDT
SELECT Name, Dates=
STUFF((SELECT ', ' + Date
FROM YourTable b
WHERE b.Country = a.Country
FOR XML PATH('')), 1, 2, '')
FROM YourTable a
GROUP BY Name
Jignesh TrivediRank #16 · 50.3K reputationPosted Jul 15, 2014, 2:03 AM EDT
Are you looking solution like hierarchical grid right?
I mean to say Date column is also contain one other grid.
please refer
http://www.dreamincode.net/forums/topic/229962-mvc-3-webgrid-inside-a-webgrid/
hope this will help you.