How can I add header GridCheckBoxColumn for select all features in RadGrid

4 posts, 0 answers
  1. Jenny
    Jenny avatar
    19 posts
    Member since:
    Oct 2018

    Posted 10 Jan Link to this post

    I have a radgrid with 2 Column of GridCheckBoxColumn View and Edit my whole project is ready only i want is that to add select all checkbox on header of radgrid. And I can not change GridCheckBoxColumn with GridTemplateColumn if I change then will face major problem.

    My code is:

    .aspx code

    <telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="true" GridLines="Vertical" OnBatchEditCommand="RadGrid1_BatchEditCommand" OnItemCreated="RadGrid1_ItemCreated" AutoGenerateColumns="False" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemDataBound="RadGrid1_ItemDataBound" OnPreRender="RadGrid1_PreRender" EnableEmbeddedSkins="false" Skin="Custom1">
                          <GroupingSettings CollapseAllTooltip="Collapse all  groups"></GroupingSettings>
                          <MasterTableView CommandItemDisplay="TopAndBottom" EditMode="Batch" DataKeyNames="FeatureID"
                              CommandItemSettings-ShowSaveChangesButton="true" CommandItemStyle-CssClass="RadGrid_Custom1" ForeColor="#000066">
                              <RowIndicatorColumn Visible="False" >
                              </RowIndicatorColumn>
                              <ExpandCollapseColumn Created="True">
                              </ExpandCollapseColumn>
                              <BatchEditingSettings Edittype="Cell"  />
                              <CommandItemSettings ShowAddNewRecordButton="False" ShowSaveChangesButton="true"></CommandItemSettings>
                              <Columns>
                                  <telerik:GridBoundColumn DataField="FeatureDesc" FilterControlAltText="Filter FeatureDesc column" ReadOnly="true" HeaderText="Feature" UniqueName="FeatureDesc" ItemStyle-HorizontalAlign="Left">
                                    <ColumnValidationSettings>
                                          <ModelErrorMessage Text="" />
                                      </ColumnValidationSettings>
                                      <HeaderStyle HorizontalAlign="Center" Width="200px" />
                                      <ItemStyle HorizontalAlign="Left" Width="200px"></ItemStyle>
                                  </telerik:GridBoundColumn>
                              </Columns>
                              <EditFormSettings>
                                  <EditColumn InsertImageUrl="Update.gif" UpdateImageUrl="Update.gif" CancelImageUrl="Cancel.gif"></EditColumn>
                              </EditFormSettings>
                              <BatchEditingSettings OpenEditingEvent="MouseOver"></BatchEditingSettings>
                          </MasterTableView>
                      </telerik:RadGrid>

    Please help me as soon as possible with better solution.

  2. Eyup
    Admin
    Eyup avatar
    3860 posts

    Posted 15 Jan Link to this post

    Hi Jenny,

    GridClientSelectColumn has already built-in header checkbox provided out-of-the-box:
    https://demos.telerik.com/aspnet-ajax/grid/examples/functionality/selecting/row-selection/defaultcs.aspx

    If you decide on using templates, you can use something similar to the attached web site sample.

    As for GridCheckBoxColumn, you can create a new asp:CheckBox in the code-behind and add it to the corresponding cell of the GridHeaderItem.

    I hope this will prove helpful.

    Regards,
    Eyup
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Jenny
    Jenny avatar
    19 posts
    Member since:
    Oct 2018

    Posted 06 Feb in reply to Eyup Link to this post

    Hi Eyup,

    Can you please tell me, for GridCheckBoxColumn, how can i create a new asp:CheckBox in the code-behind and add it to the corresponding cell of the GridHeaderItem. 

     

    Regards,
    Jennifer

  4. Eyup
    Admin
    Eyup avatar
    3860 posts

    Posted 11 Feb Link to this post

    Hello Jennifer,

    It seems that this account has no active license attached to it for Telerik UI AJAX toolset. You can contact our sales team to handle this and once this is done, we can continue with the technical question.

    Regards,
    Eyup
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top