我申請onselectedindexchangedevent上RadioButtonList的,但是當我點擊
radiobuttton,單選按鈕是不是選擇了一個運動,它選擇,然後
取消。我還設置回傳= true.but是不費一槍..SelectedIndexChanged事件不是射擊單選按鈕列表
**.aspx**
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:RadioButtonList ID="RadioButtonList1" runat="server"
AutoPostBack="true"RepeatDirection="Horizontal"OnSelectedIndexChanged="clicked">
<asp:ListItem Value="agree" Selected="True" ></asp:ListItem>
<asp:ListItem Value="agree"></asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
**.aspx.cs**
public void clicked(object sender, EventArgs arg)
{
test t = new test();
questiondal d = new questiondal();
GridViewRow row= ((RadioButtonList )sender).NamingContainer as GridViewRow;
RadioButtonList list= (RadioButtonList)row.FindControl("Radio");
list.SelectedIndexChanged();
Label4.Text= list.SelectedValue;
}
我這樣做,但仍然是事件沒有解僱 – user1479485 2012-07-05 17:26:41
你可以paset你的代碼selectedindexchanged你在線調用: list.SelectedIndexChanged(); – 2012-07-06 04:23:30