Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HOW TO DISPLAY IN GRIDVIEW?

in sql my data is in this way. there are 2 trips. 4 cloumns: trip,facility,departuretime and facility id.facility id is 676 for all.
trip  facility         departuretime        facility id

1     sector-126        6:20                     676

1     sector-130        6:40                     676

1     Noida-57          6:52                     676

1     Maple-125         7:00                     676

2     c-49              8:20                     676

2     sector-22         8:57                     676

IN my page i have a drop down. I will be selecting the facility whose facility id will be 676.
After selecting the facility it should display as below.
trip  sector 126  sector 130  Noida 57   Maple 125
1     6:20         6:40        6:52      7:00

trip  c-49    sector 22
2     8:20     8:57

Kindly guide me how can i achieve this IN GRIDVIEW. As the data in front end is rotating and also by trip wise.
Posted
Updated 10-Jun-13 21:06pm
v3
Comments
Nandakishore G N 11-Jun-13 3:12am    
paste what you have done till now?
anurag19289 11-Jun-13 3:21am    
Hi nandakishore-

There are three pages.
1)Shuttle page
2)Admin page
3)stop detail page
2nd page
Admin page --> admin adds the trip for a facility(number of trips). Then those trips are displayed on that page as a grid for a facility. then trip wise he adds the stop num and departure time[stop detail page].

3rd page
-------
Admin adds the facility and departure time and for a particular trip.


2nd and 3rd page is done.

in first page when one selects the facility. it should display as asked above.




I was asked to use repeater control.... then i was asked to use nested grid...then use pivot in sql which rotates rows to columns...then display the grid....but i am unable to do this... help please
Kschuler 11-Jun-13 12:00pm    
He meant post your code so we can help you fix it. When you say you are unable to do this, why? Is your code getting errors? If so what errors? Use the Improve Question link to add the relevant code to your question so we can help.
anurag19289 11-Jun-13 13:43pm    
hi kschuler-

this is a fresh page.i m not getting any error. i have in my database this data as mentioned above in table one above. i have to bind these data as in table 2 mentioned above by selecting the drop downlist. how to bind the data as mentioned above.
virang_21 11-Jun-13 19:06pm    
Best solution for you is to use Repeater control and add table in it with one header row for your column names and one data row for your data from database. That way you will be able to repeat the header for each row

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900