Hi,
your code is fine but need some chanages into RowataBound Event
which is as below
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DropDownList cmbtype = (DropDownList)e.Row.FindControl("cmbType");
DropDownList cmbgender = (DropDownList)e.Row.FindControl("cmbGender");
if (cmbtype != null && cmbgender !=null)
{
cmbtype.DataSource = FetchCustomerType();
cmbtype.DataTextField = "type";
cmbtype.DataValueField = "type";
cmbtype.DataBind();
cmbtype.SelectedValue = GridView1.DataKeys
e.Row.RowIndex].Values[1].ToString();
cmbgender.DataSource = FetchCustomerGender();
cmbnewgnder.DataTextField = "gender";
cmbnewgnder.DataValueField = "gender";
cmbgender.DataBind();
cmbgender.SelectedValue = GridView1.DataKeys[e.Row.RowIndex].Values[2].ToString();
}
}
}