2

我在更新面板中使用网格视图。我已将“自动生成选择按钮”属性设置为“真”,但是当我运行我的网站时,选择按钮不起作用。解决此问题的任何帮助将不胜感激。

<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>
4

1 回答 1

0

UpdatePanel 是一个嵌入式 ASP.NET 控件(不是来自 AjaxControlToolkit 项目)。将UpdatePanel 的前缀从更改ajaxToolkitasp

于 2013-06-18T13:56:10.517 回答