且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在gridview中DropDownList SelectedIndexChanged

更新时间:2023-10-07 09:56:16

受保护的 void 更改(  Object  Sender,EventArgs a)
{
DropDownList lst1 =(DropDownList)(sender);
string txt = lst1.Text;
GridViewRow gr =(GridViewRow)lst1.NamingContainer;
int i = gr.RowIndex;
string s = Gridvew1.Rows [i] .Cells [ CellNo跨度>]文本。
}



创建1个函数并从项目模板Dropdowlist SelectIndexChange调用此事件,您将获得下拉选择值​​lockquote>

请参阅:



http ://myaspsnippets.blogspot.in/2012/10/gridview-dropdownlist-selected-index.html [ ^ ]


DropDownList SelectedIndexChanged in gridview

Protected void change(Object Sender,EventArgs a)
{
DropDownList lst1=(DropDownList)(sender);
string txt=lst1.Text;
GridViewRow gr=(GridViewRow)lst1.NamingContainer;
int i=gr.RowIndex;
string s=Gridvew1.Rows[i].Cells["CellNo"].Text;
}


create 1 function and call this event from Item Template Dropdowlist SelectIndexChange and your will get dropdown selected values


Refer this :

http://myaspsnippets.blogspot.in/2012/10/gridview-dropdownlist-selected-index.html[^]