Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to select multiple values in a listbox inside of a gridview editItemTemplate?

If I have a dropdownlist I know I can..

SelectedValue='<%#Bind("AgencyID")%>' 

I want to do the same with a listbox but select multiple values. I was trying to use gridview.FindControl("listbox") but it always is null. Can someone guide me in the right direction? Thanks!

EDIT:

I am not sure whether I should edit someone else's question or not. But i have the same problem and need a good solution as soon as possible. I have already taken 2 days searching for a good solution for the same.

Please see my question

I have gone through some of the following links but didn't get much help and still trying to get the solution.

Links I have gone through http://www.gutgames.com/post/Using-a-ListBox-Using-SelectionMode-Multiple-with-a-GridView.aspx

http://forums.asp.net/t/1003876.aspx/1

like image 599
Mike Avatar asked Oct 29 '09 16:10

Mike


1 Answers

Problem solved... I just set the selected values when the listbox is being databound.

like image 185
Mike Avatar answered Nov 16 '22 23:11

Mike