Hello.
i want to fill the combobox of my datagridview (dgemployees) with the names of existing employees.
i have changed one of the coloumn of my datagridview from textbox to combobox in the designer. now how to fill the combobox of datagridview at run time.
thanks in advance for help.
mansoor
Loading
Prabhu RajaPosted Sep 30, 2011, 5:23 AM
Consider This Function, It will add value from 0 to 99 to Passed Dropdown (Incase of Web) or ComboBox (Incase of Window Application).
private void FillDropDownList(DropDownList ddl) {
for (int i=0 ; i<=100; i++)
{
ddl.Items.Add( i );
}
}
//Retrive Your Dropdown From GridView and then Pass to Function (Change Your Cell Value according to your Gridview)
DropDownList ddl1 = (DropDownList)Gridview1.Rows[0].Cells[3].FindControl("DropDownList1"); //Dropdown name
FillDropDownList(ddl1);
For your reference, i attached my Source Here. Hope It will be useful for you.
Thank You