protected void Select_Spin2_IndexChanged(object sender, EventArgs e)
{
DropDownList ddlSpin2 = (DropDownList)sender;
GridViewRow gridrow = (GridViewRow)ddlSpin2.NamingContainer;
int rowIndex = gridrow.RowIndex;
foreach (GridViewRow row in GridView_Courses.Rows)
{
if (row.RowIndex == rowIndex+1)
{
}
}
}
my aspx:
<asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Spin2" ItemStyle-Width="10%"
HeaderStyle-ForeColor="White" HeaderStyle-BackColor="steelblue" HeaderStyle-BorderWidth="0"
HeaderStyle-BorderStyle="Dashed" HeaderStyle-BorderColor="Black">
<ItemTemplate>
<asp:DropDownList runat="server" ID="Select_Spin2" AutoPostBack="true" OnSelectedIndexChanged="Select_Spin2_IndexChanged" />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle Width="10%" />
</asp:TemplateField>