【问题标题】:Persisting Checkbox state while paging in SPGridView在 SPGridView 中分页时保持复选框状态
【发布时间】:2011-03-24 06:19:01
【问题描述】:

假设我使用以下代码创建了一个 spgridview。

<SharePoint:SPGridView ID="spgridList" Visible="false" runat="server" AutoGenerateColumns="false"
                        Width="100%" AllowPaging="true" AllowSorting="true" AllowFiltering="true" PageSize="5"
                        OnPageIndexChanging="spgridList_PageIndexChanging" HeaderStyle-BackColor="Red"
                        onrowdatabound="spgridList_RowDataBound" onrowcommand="spgridList_RowCommand">
                        <PagerStyle CssClass="ms-descriptiontext" />
                        <HeaderStyle BackColor="Blue" ForeColor="Black" Font-Bold="true" />
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:CheckBox CssClass="chkbox" Checked="false" ID="chkField" AutoPostBack="true"
                                        OnCheckedChanged="chkField_CheckedChanged" runat="server" />
                                </ItemTemplate>
                                <HeaderTemplate>
                                    <asp:CheckBox ID="chkSelectAll" runat="server" AutoPostBack="true" OnCheckedChanged="chkAll_CheckedChanged" />
                                </HeaderTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </SharePoint:SPGridView>

要在pagebacks之间保持复选框状态,目前我正在使用会话状态。它有一些缺点。现在我如何保持选中状态,当用户手动检查所有复选框时,我如何检查标题复选框?提供一些链接

【问题讨论】:

    标签: asp.net checkbox persistence session-state aspxgridview


    【解决方案1】:

    如何像选择 CheckBox 一样模拟它,但禁用行的焦点?

    行的选择是跨页面维护的。

    http://www.devexpress.com/Support/Center/p/E1559.aspx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多