Grouping in any one of the asp.net controls like Gridview,listview,datalist,detailview,repeater..

Posted by Vinaykumarpal under ASP.NET on 2/6/2012 | Points: 10 | Views : 1986 | Status : [Member] | Replies : 1
hi
i am having a problem with grouping department wise


I have a table employee
Empid Firstname LastName Designation Department
1 Vinay Kumar Trainee IT
2 Preety Gupta Trainee IT
3 Sajjan Kumar Trainee IT
4 Raju Singla soft engg Testing
5 Rakesh Kumar Administrator Admin

I want it to look like as in GridView Dynamically

Empid Firstname LastName Designation
IT :
1 Vinay Kumar Trainee
2 Preety Gupta Trainee
3 Sajjan Kumar Trainee
Testing:
4 Raju Singla soft engg
Admin :
5 Rakesh Kumar Administrator


please give me full code for this......
Thanking You
Regards
Vinay Kumar
www.vinaykumarpal.co.cc

Vinay Kumar


Responses

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

Up
0
Down
Hi,

You can implement this using two list controls. For example use one repeater control to list the department and add another inner repeater to list the employee of the corresponding department. Normal bind method in the page load to bind the department and bind the child repeater in the ItemDataBound event of the department repeater. Try this and let me know if you are facing any issue.

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

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

Login to post response