如何给Gridview下的DropDownList 添加一个OnSelectedIndexChanged事件

来源:百度知道 编辑:UC知道 时间:2024/06/04 10:04:27
哪位大哥帮忙看下,顺便写下怎么添加:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound"
OnRowCommand="GridView1_RowCommand" OnRowUpdating="GridView1_RowUpdating" AllowPaging="True"
PageSize="5" OnPageIndexChanging="GridView1_PageIndexChanging" OnSorting="GridView1_Sorting"
OnRowDeleting="GridView1_RowDeleting" Width="99.5%">
<PagerSettings FirstPageText="首页" LastPageText="尾页"
Mode="NextPreviousFirstLast" NextPageText="下一页" PreviousPageText="上一页" />
<Columns>
<asp:ButtonField Text="SingleClick" CommandName="SingleClick" Visible="False" />
<asp:TemplateField Hea

编辑gridview的模板时,找到你要产生事件的dropdownlist控件,双击该控件就会在cs文件里自动出现dropdownlist的事件了,但你要记得在aspx文件里的dropdownlist的属性里添加autopostback = TRUE,这个事件才会被触发

DropOnSelectedIndexChanged这个事件你是怎么点出来的啊?这个是GridView 的事件吧,而不是DropDownList的

你的DropDownList应该到GridView 的模板列里面去找,然后选中DropDownList,在DropDownList的事件里去找SelectedIndexChanged