why is it that
string submenuList = ((DropDownList)SubMenuGrid.Rows[e.RowIndex].Controls[e.RowIndex].FindControl("menuContainerList")).SelectedItem.Value; Produces an object reference error...
I populated the control using... this code
DataTable menuContainers = BrochureAccess.getContainerMenus();
for (int i = 0; i < menuContainers.Rows.Count; i++)
{
((DropDownList)SubMenuGrid.Rows[e.NewEditIndex].FindControl("menuContainerList")).Items.Add(new ListItem(menuContainers.Rows[i]["menu_TITLE"].ToString(), menuContainers.Rows[i]["menu_ID"].ToString()));
}
If i hardcoded the list in .aspx everything goes fine... but I need to populate the dropdown list from database ...
could somebody help me....