In my project I have to handle the event of drop-down control in repeater control and also want the current item index. I get how to handle the event but I need to burn my midnight's oil to get the current item index and finally I got the solution using NamingContainer property.
Following is the sample code for repeater control and drop-down control in it
<asp:Repeater ID="myRepeater"
runat="server">
<ItemTemplate>
<asp:DropDownList ID="myDropdown"
runat="server"
AppendDataBoundItems="true"
AutoPostBack="true" OnSelectedIndexChanged="myDropdown_SelectedIndexChanged">
</asp:DropDownList>
</ItemTemplate>
</asp:Repeater>
Added the event myDropdown_SelectedIndexChanged to the code behind as follows :

Pratik PatelPosted Aug 23, 2016, 2:21 AM
Int currentItemIndex = ((RepeaterItem)drpVariants.NamingContainer).ItemIndex; what is drpVariants????????
Sr KarthigaPosted Apr 3, 2016, 12:01 AM
good one
Sr KarthigaPosted Apr 3, 2016, 12:01 AM
nice explanation
Asfend YarPosted Feb 29, 2016, 5:58 AM
good