Gridview Bind method ?

Posted by Chandru_ra under ASP.NET on 2/9/2012 | Points: 10 | Views : 1593 | Status : [Member] | Replies : 4
Hi,

am using gridview bind method but repeat row in the table.

am using query:

SELECT a.sno,a.menuname,b.submenu,b.sno from submenu as b inner join topmenu as a on a.sno=b.menuid INNER JOIN Submenulist as c ON b.sno=c.submenuid group by a.sno,a.menuname,b.submenu,b.sno

output:

1 Websit Manager Domain Manager 1
2 Table Reservation Restaurant Manager 1
3 Costomer Manager Team Manager 1
4 Urbane News & Events 1
5 Discover Careers 1
6 Vehicle Maintanance Customer Feedback 1
7 Sales Photo Gallery 1
8 Reports Manage Videos 1
9 Manage Users Health Tips 1
10 Websit Manager Food Menu Manager 1

but i want output:

this format:

websitemanager this main menu

websitemanager
Domain Manager- this is submenu links
Restaurant Manager
Team Manager
Customer Feedback
Food Menu Manager

Table Reservation-this is another main menu

Add new table reservation
Customer manager
Add customer

Thanks to all

chandru


Responses

Posted by: Blessyjees on: 2/9/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi,

not clear your needed format. Only one main menu and other are sub menu, right? If no please specify how to display the data in grid view.

Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Chandru_ra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chandru_ra on: 2/9/2012 [Member] Starter | Points: 25

Up
0
Down
this format:

websitemanager this main menu

websitemanager
Domain Manager- this is submenu links
Restaurant Manager
Team Manager
Customer Feedback
Food Menu Manager

Table Reservation-this is another main menu

Add new table reservation
Customer manager
Add customer

Thanks to all

chandru

Chandru_ra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 2/9/2012 [Member] Silver | Points: 25

Up
0
Down
Why dont you do a nested gridview
1.Outer gridview has to get all Menu details from Menu table
2. and then Each menu has 1 or more sub menu which has to be child members of menu so call submenu items using datakey value of outer gridview.




Thanks,
Sanjay

Chandru_ra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naraayanan on: 2/14/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
Please send your Table structure for main menus and Sub menus.

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

Chandru_ra, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response