Connecting Tech Pros Worldwide Forums | Help | Site Map

set FormView's dropdownlist controls datasource dynamically

Rabbit
Guest
 
Posts: n/a
#1: Mar 20 '06
Hi, All,

I have a FormView, in which the InsertItemTemplate has a dropdownlist that I
need to set the datasource as my self created dataset.

I have been trying various syntax like following at formview Init or
ItemCreated event:
Dim cbo As DropDownList =
CType(Me.fmViewUser.Row.Cells(0).FindControl("ddNa meInsert"), DropDownList)
or
Dim cbo As DropDownList =
CType(Me.fmViewUser.Row.FindControl("ddNameInsert" ), DropDownList)

But I still can access such dropdownlist, and keeps prompting "Object
reference not set to an instance of object".

Has anyone got idea how to fix it? or telling me how to set a control inside
a formView Control?

Thanks in advnace
Keith



Closed Thread