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

Posted by Vinaykumarpal under ASP.NET on 2/6/2012 | Points: 10 | Views : 2124 | Status : [Member] | Replies : 1
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
4 Raju Singla soft engg
Admin :
5 Rakesh Kumar Administrator

please give me full code for this......
Thanking You
Vinay Kumar

Vinay Kumar


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


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

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

Login to post response