Dropdownlist in Grid View
-
Hi, I have one gridview control with two hidden fields and one dropdownlist. AutoPostback property of dropdownlist is true. Now , when selected_index_changed event of dropdownlist fire, that time i want to know that at which row index dropdownlist is.
kiranbanker
-
Hi, I have one gridview control with two hidden fields and one dropdownlist. AutoPostback property of dropdownlist is true. Now , when selected_index_changed event of dropdownlist fire, that time i want to know that at which row index dropdownlist is.
kiranbanker
I have one gridview control with two hidden fields and one dropdownlist. AutoPostback property of dropdownlist is true. You can use Item template for inserting a dropdownlist in the datagrid . Now , when selected_index_changed event of dropdownlist fire, that time i want to know that at which row index dropdownlist is. Now in the code behind write the following code. protected void DropDown_SelectedIndexChanged(object sender, EventArgs e) { DropDownList list = (DropDownList)sender; if(list.SelectedItem.Text=="......."; ..... //To get the corresponding row TableCell cell = list.Parent as TableCell;// getting the parent cell of dropdown DataGridItem item = cell.Parent as DataGridItem;//getting the parent of tablecell ie the row string p_key=item.Cells[2].Text.Trim();//getting the column values of the row ........ Tickle your brain and the ideas are out