Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   dropdown list can't selected. (http://www.velocityreviews.com/forums/t61582-dropdown-list-cant-selected.html)

lucy 08-05-2003 07:57 PM

dropdown list can't selected.
 
I have a EditItemTemplate in a datagrid that contain a
dropdown that bound to a dataset. In that grid I have a
ItemCreated to handle the dropdow created. But the
selected item is not work. I tried 3 ways. see code.

Thanks.


Private Sub dgFundList_ItemCreated(ByVal sender As
Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgFundList.ItemCreated
Dim elemType As ListItemType
elemType = e.Item.ItemType

If elemType = ListItemType.EditItem Then
Dim ddlUserName As DropDownList = CType
(e.Item.FindControl("ddlUserName"), DropDownList)

ddlUserName.DataSource = dtUser
ddlUserName.DataTextField = "FullName"
ddlUserName.DataValueField = "UserID"

ddlUserName.DataBind()
'ddlUserName.SelectedItem.Selected = False
'ddlUserName.Items.FindByValue
("11111").Selected = true
'ddlUserName.Items.FindByText
("mytext").Selected = True
ddlUserName.SelectedIndex =
ddlUserName.Items.IndexOf(ddlUserName.Items.FindBy Value
("11111"))
End If


All times are GMT. The time now is 01:45 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57