Preserver CheckBox State On RadGrid

5 posts, 0 answers
  1. Chamara
    Chamara avatar
    40 posts
    Member since:
    Jun 2011

    Posted 07 Nov 2011 Link to this post

    I have a RadGrid and a RadPanelBar in my content page.i'm using RadAjaxLoadingPanel for the grid.inside RadPanelBar i have two dropdowns based on the selection made by the dropdowns i have loaded the radGrid.i have a checkBox column in the radGrid.what i need is in need to preserve the checkBox state on the dropdown selection change which cause a postback currently.following are some important parts of my code and please help me with the issue.

    <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
        <AjaxSettings>
            
                <telerik:AjaxSetting AjaxControlID="Panel1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                     </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadPanelBar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlDAreaFacility" />
                    <telerik:AjaxUpdatedControl ControlID="ddlDCus" />
                </UpdatedControls>
            </telerik:AjaxSetting>        
          </AjaxSettings>
    </telerik:RadAjaxManagerProxy>




       <telerik:RadPanelBar ID="pnlSearchL2" runat="server" Width="98%" 
                Font-Name="Eras Medium ITC" Font-Size="Small" Skin="Office2007" 
                Font-Names="Eras Medium ITC">
                <Items>
                   <telerik:RadPanelItem Text="Search Level 2" runat="server" 
                        Font-Names="Eras Medium ITC">
               <ContentTemplate>
            
                 <div id="divDesignSearchL2" runat="server">
            
       <table width="100%">
                <tr>
                    <td>
                        <asp:Label ID="lblDAreaFacility" runat="server" BackColor="White" 
                            Text="ABS(Area/Facility)" Font-Name="Eras Medium ITC" Font-Size="X-Small" 
                            Font-Names="Eras Medium ITC"/>
                   </td>
                    <td style="font-family: 'Eras Medium ITC'; font-size: x-small">
                       <telerik:RadComboBox ID="ddlDAreaFacility" runat="server" 
                             Skin="Office2007" 
                            onselectedindexchanged="ddlDAreaFacility_SelectedIndexChanged" 
                            Font-Name="Eras Medium ITC" Font-Size="X-Small" AutoPostBack="true">
                   </telerik:RadComboBox>
                        
                    </td>
                    <td class="tdWidth">
                         <asp:Label ID="lblDCus" runat="server" BackColor="White" Text="Custom Field" 
                             Font-Names="Eras Medium ITC" Font-Size="X-Small"/>
                        </td>
                    <td>
                       <telerik:RadComboBox ID="ddlDCus" runat="server" Skin="Office2007" 
                            Font-Name="Eras Medium ITC" Font-Size="X-Small" 
                             AutoPostBack="true">
                            
                   </telerik:RadComboBox>
    </telerik:RadPanelBar>




    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
            <fieldset class="module1">
            <asp:Panel ID="Panel1" runat="server" HorizontalAlign="Center" >
          
            <telerik:RadGrid ID="gridSearchL3" runat="server" AllowPagg="True" AutoGenerateColumns="true"  
                 GridLines="None" Skin="Office2007" Height="415px" 
                 OnExcelMLExportRowCreated="gridSearchL3_ExcelMLExportRowCreated" OnExcelMLExportStylesCreated="gridSearchL3_ExcelMLExportStylesCreated"
                OnGridExporting="gridSearchL3_GridExporting"  oninit="gridSearchL3_Init" OnNeedDataSource="RadGrid1_NeedDataSource"
                Font-Names="Eras Medium ITC" Font-Size="Small" PageSize="50" 
                 AllowFilteringByColumn="True" onitemcreated="gridSearchL3_ItemCreated" 
                
                 onselectedindexchanged="gridSearchL3_SelectedIndexChanged" 
                 AllowSorting="True" ShowStatusBar="True" AllowPaging="True">
                   <FilterItemStyle Font-Names="Eras Medium ITC" Font-Size="XX-Small" />
                   <GroupingSettings CaseSensitive="False" />
                <ExportSettings Excel-Format="ExcelML" ExportOnlyData="True" 
                    FileName="PinC Group" IgnorePaging="True" OpenInNewWindow="True">
                    <Excel Format="ExcelML" />
                </ExportSettings>
                <ClientSettings>
                    <ClientEvents OnRowClick="onRowClick" OnRowSelected="RowSelected" />
                    <Selecting AllowRowSelect="True" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                </ClientSettings>
                <AlternatingItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
                <GroupHeaderItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
                <SortingSettings EnableSkinSortStyles="false" /> 
                <MasterTableView ClientDataKeyNames="Document #,Revision,hID,ID" Font-Names="Eras Medium ITC" 
                       Font-Size="X-Small">
               
                    <CommandItemSettings ExportToPdfText="Export to Pdf" />


                    <Columns>


                        <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="template" >
                            <ItemTemplate>
                                <asp:CheckBox ID="CheckBox1" runat="server" OnCheckedChanged="ToggleRowSelection" AutoPostBack="true"/>
                            </ItemTemplate>
                            <HeaderTemplate>
                                <asp:CheckBox ID="CheckBoxHeader" OnCheckedChanged="Header_checkedChange" runat="server" AutoPostBack="true"/>
                            </HeaderTemplate>
                        </telerik:GridTemplateColumn>
                    
                        <telerik:GridButtonColumn  Text="View" CommandName="Select" UniqueName="LinkColumn"></telerik:GridButtonColumn>
                       
                    </Columns>
                    <ItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                    <FilterItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
                </MasterTableView>
                <EditItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
                <FooterStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
                <HeaderStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
                <FilterItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
                   <CommandItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
                   <ActiveItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
                   <ItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
                   <PagerStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" 
                       HorizontalAlign="Left" Mode="NextPrevNumericAndAdvanced" />
                   <SelectedItemStyle Font-Names="Eras Medium ITC" Font-Size="X-Small" />
                   <FilterMenu Font-Names="Eras Medium ITC" Font-Size="X-Small" 
                    Skin="Office2007" EnableRoundedCorners="True">
                   </FilterMenu>
                   <HeaderContextMenu Font-Names="Eras Medium ITC" Font-Size="X-Small" 
                       Skin="Simple">
                   </HeaderContextMenu>
                   </telerik:RadGrid>
            
            </asp:Panel>
        </fieldset>

             

  2. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 07 Nov 2011 Link to this post

    Hello Chamara ,

    Go through the following help article which explains how to maintain CheckBox state on rebind.
    Persisting CheckBox control state in GridTemplateColumn on rebind

    You can also refer the following help article which explains how to maintain selected rows on paging.
    Persisting the selected rows on sorting/paging/filtering/grouping

    Thanks,
    Jayesh Goyani
  3. Chamara
    Chamara avatar
    40 posts
    Member since:
    Jun 2011

    Posted 07 Nov 2011 Link to this post

    hi jayesh!
    you'r both links are unavailable.please correct it
  4. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 07 Nov 2011 Link to this post

    Hello,

    I updated my last post now check are worked fine.

    Thanks,
    Jayesh Goyani
  5. franklin arturo
    franklin arturo avatar
    1 posts
    Member since:
    May 2018

    Posted 23 May 2018 Link to this post

    Hey, I've tried the link above and the information is gone, also, I tried other post with the same issue and the correct answer is always a  broken link, like these:

    https://www.telerik.com/forums/retaining-checkbox-selection-server-side-on-a-radgrid-using-advanced-data-binding

    https://www.telerik.com/forums/persist-checkbox-s-checked-status-while-filtering

    https://www.telerik.com/forums/persisting-check-box-checked-status-after-paging-in-grid-client-select-column

    Can you help me with the information?, Please

    Thanks, Franklin

Back to Top