M
mark.norgate
Hi
Another problem...
My drop down is always defaulting to selecting the first item in the
drop down, even though I've got code specifically to change it to a
different item:
Dim adapter As SqlDataAdapter = New
SqlDataAdapter("SELECT appId, appName FROM application WHERE segmentID
= " + segmentID.ToString(), connection)
Dim dataSet As DataSet = New DataSet()
adapter.Fill(dataSet)
ApplicationDropDown.DataValueField = "appId"
ApplicationDropDown.DataTextField = "appName"
ApplicationDropDown.DataSource = dataSet
ApplicationDropDown.DataBind()
ApplicationDropDown.Items.FindByValue(ApplicationId.ToString()).Selected
= True
Why is the item not being selected? I've checked that the
ApplicationId is correct and it is. I'm really scratching my head on
this one.
Mark
Another problem...
My drop down is always defaulting to selecting the first item in the
drop down, even though I've got code specifically to change it to a
different item:
Dim adapter As SqlDataAdapter = New
SqlDataAdapter("SELECT appId, appName FROM application WHERE segmentID
= " + segmentID.ToString(), connection)
Dim dataSet As DataSet = New DataSet()
adapter.Fill(dataSet)
ApplicationDropDown.DataValueField = "appId"
ApplicationDropDown.DataTextField = "appName"
ApplicationDropDown.DataSource = dataSet
ApplicationDropDown.DataBind()
ApplicationDropDown.Items.FindByValue(ApplicationId.ToString()).Selected
= True
Why is the item not being selected? I've checked that the
ApplicationId is correct and it is. I'm really scratching my head on
this one.
Mark