1
假設我使用以下代碼創建了spgridview。在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之間的複選框狀態,目前我使用的會話states.It有一些抽獎backs.Now我怎麼能堅持選中狀態,當用戶手動檢查所有的複選框,我怎樣才能使檢查標題複選框?提供一些鏈接