hi,
i have added columns to the gridview like this dynamically
BoundField bField = new BoundField();
bField.HeaderText = Label6.Text;
GridView2.Columns.Add(bField);
for to get dropdownlist inside the gridview i have written code like this in GridView2_RowCreated event
TableCell tc = new TableCell();
DropDownList ddlnewList = new DropDownList();
e.Row.Cells.Add(tc);
for to get the selected value from dropdownlist i have written like this in button_Clkick event
if (r.RowType == DataControlRowType.DataRow)
{
foreach (GridViewRow r in GridView2.Rows)
{
DropDownList
box1 = (DropDownList)GridView2.Rows[i].Cells[1].FindControl("ddlnewList");
string s= box1.SelectedItem.Text;
}
}
but i am getting null value at box1 Thanks in advance..