[英]Ajax grid view in update panel select not working
我在更新面板中使用了網格視圖。 我已經將“自動生成選擇按鈕”屬性設置為“ true”,但是當我運行我的網站時,選擇按鈕不起作用。 解決該問題的任何幫助將不勝感激。
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
<div style="overflow: scroll; width: 100%; height: 350px">
<ajaxToolkit:UpdatePanel ID="updatepanel1" runat="server">
<ContentTemplate>
<asp:GridView id="GridView1" runat="server" Width="754px" OnRowDataBound="GridView1_RowDataBound" DataKeyNames="UniqueID" GridLines="None" ForeColor="#333333" EmptyDataText="There are no data records to display." DataSourceID="sdsMapsAdd" CellPadding="4" AutoGenerateColumns="False" AllowSorting="True" AllowPaging="False" OnRowCommand="GridView1_RowCommand" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="UniqueID" HeaderText="ID" ReadOnly="True"
SortExpression="UniqueID" Visible="false" />
<asp:BoundField DataField="SiteName" HeaderText="Name" ReadOnly="True"
SortExpression="SiteName" />
<asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
</Columns>
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
</ContentTemplate>
</ajaxToolkit:UpdatePanel>
</div>
<asp:SqlDataSource ID="sdsAdd" runat="server" ConnectionString="<%$ ConnectionStrings:AddConnectionStrings %>"
SelectCommand="SELECT ID,Name,Address FROM [Data]where Status=1 order by Name"
>
</asp:SqlDataSource>
</asp:Content>
UpdatePanel是嵌入式ASP.NET控件(不是來自AjaxControlToolkit項目)。 將前綴從ajaxToolkit
更改為UpdatePanel的asp
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.