0
Thank you but the error is persistent.
Object reference not set to an instance of an object on:
protected void OnDataBound(object sender, EventArgs e)
{
sql = "SELECT ";
sql = sql + " denom
sql = sql + "FROM ";
sql = sql + " tbl_xxx; ";
DropDownList Newcombo = DecoderView.FooterRow.FindControl("Newcombo") as DropDownList;
Newcombo.DataSource = GetData(sql);
Newcombo.DataTextField = "denom";
Newcombo.DataValueField = "denom";
Newcombo.DataBind();
Newcombo.Items.Insert(0, new ListItem("------", ""));
}
in this line:
DropDownList Newcombo = DecoderView.FooterRow.FindControl("Newcombo") as DropDownList;
0
Hi,
Remove the DecoderView.DataBind(); from all place and use the below code
protected override void OnPreRenderComplete(EventArgs e)
{
DataBind();
base.OnPreRenderComplete(e);
}
Regards,
Iftikar