ASP.NET中GridView模板列dropDownList当前行索引示例
ASP.NET中GridView模板列DropDownList当前行索引写法
protected void DDLAnnex_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList drp = sender as DropDownList; // 触发事件的 DropDownList
GridViewRow row = drp.NamingContainer as GridViewRow; // GridView 当前行
row.Style.Add(HtmlTextWriterStyle.BackgroundColor, drp.SelectedValue);
int CurRow = row.RowIndex;
}