View Single Post
  #5 (permalink)  
Old December 1st, 2004, 05:24 PM
mehdi62b mehdi62b is offline
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

you could bind your DropDownList in ItemDataBound event this event fires after datagrid bindings,
Code:
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
            if (e.Item.ItemType == ListItemType.Item ||
                e.Item.ItemType == ListItemType.AlternatingItem ||
                e.Item.ItemType == ListItemType.SelectedItem ||
                e.Item.ItemType == ListItemType.EditItem)
            {    
                    DropDownList ddlInspectors = (DropDownList) e.Item.FindControl("mydrop");
                    ddlInspectors.DataTextField = "ASPECTID";
                    ddlInspectors.DataValueField = "ASPECTID";
                    ddlInspectors.DataSource = ds.Tables[1].DefaultView;
                    ddlInspectors.DataBind();
                }
            }

}
_____________________________
Mehdi.
software engineering student.
Looking for a good job for summer 2005.