This is a migrated thread and some comments may be shown as answers.

Preserver CheckBox State On RadGrid

4 Answers 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chamara
Top achievements
Rank 1
Chamara asked on 07 Nov 2011, 01:32 PM
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>

         

4 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 07 Nov 2011, 01:53 PM
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
0
Chamara
Top achievements
Rank 1
answered on 07 Nov 2011, 02:49 PM
hi jayesh!
you'r both links are unavailable.please correct it
0
Jayesh Goyani
Top achievements
Rank 2
answered on 07 Nov 2011, 04:04 PM
Hello,

I updated my last post now check are worked fine.

Thanks,
Jayesh Goyani
0
franklin arturo
Top achievements
Rank 1
answered on 23 May 2018, 03:50 PM

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

Tags
Grid
Asked by
Chamara
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Chamara
Top achievements
Rank 1
franklin arturo
Top achievements
Rank 1
Share this question
or