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

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

3 Answers 1055 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Jenny
Top achievements
Rank 2
Jenny asked on 10 Jan 2019, 11:44 AM

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.

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 15 Jan 2019, 10:21 AM
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.
0
Jenny
Top achievements
Rank 2
answered on 06 Feb 2019, 10:33 AM

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

0
Eyup
Telerik team
answered on 11 Feb 2019, 08:29 AM
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.
Tags
Menu
Asked by
Jenny
Top achievements
Rank 2
Answers by
Eyup
Telerik team
Jenny
Top achievements
Rank 2
Share this question
or