I
Islam Elkhayat
In my webproject i have a datagrid.. i added a DropDownList in the edit mde
and in the Datagrrd1_ItemDataBound i bind data from dataview using:
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
DropDownList list = (DropDownList)Datagrid1.FindControl("myddl");
list.DataSource = dv;
list.DataTextFeild= "Name";
list.DataValueFeild = "ID";
list.DataBind();
but i got and "object refrence not set to an instance of an object"
Exception..
it seem it's try to bind data b4 creating the DropDownlist itself!!
i add another Dropdownlist outside the grid which use the same Datasource
and it's wrk perfectly.
and in the Datagrrd1_ItemDataBound i bind data from dataview using:
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
DropDownList list = (DropDownList)Datagrid1.FindControl("myddl");
list.DataSource = dv;
list.DataTextFeild= "Name";
list.DataValueFeild = "ID";
list.DataBind();
but i got and "object refrence not set to an instance of an object"
Exception..
it seem it's try to bind data b4 creating the DropDownlist itself!!
i add another Dropdownlist outside the grid which use the same Datasource
and it's wrk perfectly.