S
Sam
Hi All,
I'm having troubles with populating data to the dropdownlist in a datagrid
and I just don't know what causes it. I have been struggling for 2 days now
Would some one give me a hand?
Here is what I have in the ItemDataBound
Dim ddlProduct As DropDownList =
CType(e.Item.Cells(1).FindControl("ddlFinalOffer"),
System.Web.UI.WebControls.DropDownList)
Dim ds1 As DataSet
ds1 = CreateDataSet()
ddlProduct .DataTextField = "ProductDesc"
ddlProduct.DataValueField = "ProductID"
ddlProduct .DataSource = ds1.Tables(0)
ddlProduct.DataBind()
some how I keep having null reference error and when I debug it, the
ddlProduct variable shows "nothing" when I hover my mouse on this variable.
It breaks when I tried to assign datafield to it. The code above shows ok
if I put in the "edit" event handler of the datagrid but the data does not
get populated in the dropdownlist.
Regards,
Sam
I'm having troubles with populating data to the dropdownlist in a datagrid
and I just don't know what causes it. I have been struggling for 2 days now
Would some one give me a hand?
Here is what I have in the ItemDataBound
Dim ddlProduct As DropDownList =
CType(e.Item.Cells(1).FindControl("ddlFinalOffer"),
System.Web.UI.WebControls.DropDownList)
Dim ds1 As DataSet
ds1 = CreateDataSet()
ddlProduct .DataTextField = "ProductDesc"
ddlProduct.DataValueField = "ProductID"
ddlProduct .DataSource = ds1.Tables(0)
ddlProduct.DataBind()
some how I keep having null reference error and when I debug it, the
ddlProduct variable shows "nothing" when I hover my mouse on this variable.
It breaks when I tried to assign datafield to it. The code above shows ok
if I put in the "edit" event handler of the datagrid but the data does not
get populated in the dropdownlist.
Regards,
Sam