Click to See Complete Forum and Search --> : Select Item in Bound Dropdown List


lrrajesh
02-14-2007, 02:18 AM
Hi ,

Thanks in advance.

Can any one help to sort out the following trouble.


I got a dropdown list which populates its value from DB the help of Datasource control(ASP.NET 2.0). I want to select an item in the dropdownlist . I tried DrpListManager.Items.FindByValue() already.. but it is generating exceptions.. Please help me

Regards,
Rajesh

Ribeyed
02-14-2007, 02:56 AM
Hi,

DropDownList.SelectedValue = 1 etc...

lrrajesh
02-14-2007, 07:34 PM
Thanks for your comment.

But Dropdpwnlist.selectedvalue also did not work.. No effect when using selected value.. I think Slected value does not work in ASP.NET 2.0.Any other option available?

thanks,
rajesh

lmf232s
02-14-2007, 09:23 PM
irrajesh,
Can you post some code?

lrrajesh
02-14-2007, 11:48 PM
Thanks buddies to spend your time on this..


I found the solution. It was (FindByValue) not working since I used the SqlDataSource as the Datasource. I tried it by populate fields using Code and then used FindByValue .. it worked. I think the problem was because of Late databinding..


Thanks

Rajesh