Sort DatagridView
-
Hi Friends, Sorry for repeating this question. How to sort the datagridview unbounded columns in c#.net.Its urgent for me. Please Help. Code: ICollection userDetails = new ArrayList(); domainUser = SessionData.LoginName; domainPassword = SessionData.Password; userDetails=GetAllUsers(DEFAULTDOMAIN, domainUser, domainPassword); (Here GetAllUsers is a method which returns all the user details from the domain). dgAddressBook.DataSource = userDetails; Full Details are listed in Datagridview. But I need to display the records based on the Column Firstname - ascending order). Thanks in Advance, Regards,
Prya
-
Hi Friends, Sorry for repeating this question. How to sort the datagridview unbounded columns in c#.net.Its urgent for me. Please Help. Code: ICollection userDetails = new ArrayList(); domainUser = SessionData.LoginName; domainPassword = SessionData.Password; userDetails=GetAllUsers(DEFAULTDOMAIN, domainUser, domainPassword); (Here GetAllUsers is a method which returns all the user details from the domain). dgAddressBook.DataSource = userDetails; Full Details are listed in Datagridview. But I need to display the records based on the Column Firstname - ascending order). Thanks in Advance, Regards,
Prya
-
If you are using framework 2, use a SortedList instead of ArrayList, or a List and use it's Sort method. Otherwise, you can use the Sort method of the ArrayList.
--- Year happy = new Year(2007);
THank u so much. I applied it like, ICollection userDetails = new SortedList(); But the contents are not sorted. Can u pls. suggest me what was the problem. Regards,
Prya
-
THank u so much. I applied it like, ICollection userDetails = new SortedList(); But the contents are not sorted. Can u pls. suggest me what was the problem. Regards,
Prya