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 |
|
Jignesh TrivediPosted Jul 15, 2014, 6:03 AM
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.
Jaganathan BantheswaranPosted Jul 15, 2014, 5:48 AM
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
srujana thallamPosted Jul 15, 2014, 5:06 AM
I am using DB2 database
srujana thallamPosted Jul 15, 2014, 3:39 AM
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.
Jaganathan BantheswaranPosted Jul 15, 2014, 3:35 AM