asoundmind
Member
- Joined
- Apr 14, 2007
- Messages
- 6
- Programming Experience
- Beginner
Hallo there, I am having a problem on hiding gridview columns based on values selected on a listbox. For example I have a gridview, a listbox and a button. The gridview consists of 3 columns: userID, FirstName and LastName. So Does the listbox contains 3 items: userID, FirstName, and lastname. What I need is, if user clicks on FIRSTNAME in the listbox and click on the button, the FIRSTNAME column can be hidden. I have tried to use gridview.columns(i).visible but this is not what I want 'coz the values of i are determined of the order of listbox. Thus, it makes column with the order of i invisible. How to select the column based on its name (userID, FirstName, LastName)? Is there a better solution to achieve what I need? Appreciate if you guys can help me with this problem. Thank you