Template Field in gridview that fires drop down selected index changed event getting row index
I have a template field in the item template of a gridview. The template field is a status dropdownlist that fires an onindexchanged event for the drop down. I need to reference the row index of the row that fired the drop down on index changed.
Nothing chages in the gridview so I cant reference the datakey, or use the row event args cause it is a template field off of the item template. No row is selected, so is there a way to get that information his way???
Protected Sub drpStatus_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim strStatus as String = sender.SelectedValue Dim strID as String = Gridiew1.SelectedRow.Items.cells(0) or something like Dim strID as String = GridView1.SelectedDataKey End Sub
Dim ddl As DropDownList = CType(sender, DropDownList)
dim theindex as int32 = ddl.SelectedIndex