Index of the selected item in combobox Datagridview
Visual Basic
2
Posts
2
Posters
0
Views
1
Watching
-
HI, how can i get the index of the selected item in the combobox in a column of the dataGridView? thanks, regards
check out this code aspx page asp:datagrid id="Datag" runat="server" Width="100%" AutoGenerateColumns="False" PageSize="10" asp:TemplateColumn HeaderText="Dropdown test" ItemTemplate asp:DropDownList id="DropdownAction" AutoPostBack="True" OnSelectedIndexChanged="DdAction_SelectedIndexChanged" Runat="server" Code behind file (.cs) public void DdAction_SelectedIndexChanged(object sender, System.EventArgs e) { DropDownList list = (DropDownList)sender; if (list.SelectedIndex == 0) { //Actions for item 1 } else if (list.SelectedIndex == 1) { //Actions for item 2 } } Navi