Posted on: 7/20/2013 9:15:00 AM | Views : 199

Hello 

i have a problem related to drop down gridview

the problem is when i search a data its give me ---------select ------------ result in dropdown
like this

ShiftID-------------------------Shift
1---------------------------|----Select-----|
2---------------------------|-----Select----|
i want a data value who stored in database


this is my C# coding of gridview

protected void gvUserInfo_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { con.Open(); var ddl = (DropDownList)e.Row.FindControl("ddlshift"); SqlCommand cmd = new SqlCommand("select * from shift", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); con.Close(); ddl.DataSource = ds; ddl.DataTextField = "shift&q ...

Go to the complete details ...