Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to implement select/unselect for all rows in a group row

$
0
0

This example demonstrates how to implement select/unselect for all rows in a group row.

It's possible to implement this behavior only by using ASPXGridView 9.1. For more information, please refer to Add client- and server-side methods to obtain rows belonging to a certain group.

First, place ASPxCheckBox and ASPxLabel into the Grid.Templates.GroupRowContent template.

Second, set the ASPxCheckBox.Checked property and the client-side ASPxCheckBox.ClientSideEvents.CheckedChanged event in the ASPxGridView.HtmlRowPrepared event handler.

In this example the ASPxLabel.Text is bound in the markup using Two-Way DataBinding.

See also
How to implement select/unselect for all rows in a group row in ASPxGridLookup

Question Comments

Added By: Brian Dukes 2 at: 7/15/2013 8:39:14 AM    

I'm looking to do this exact thing in the latest 13.1.5 ASP.NET MVC controls -- How can this be done?

Added By: Gustavo Becerril at: 6/27/2014 4:38:28 PM    

This example doesn't take into account grouping by more than one field, it merely selects the first item of every subgroup. I'd love to find out if there's a not-so resource intensive way to select every item inside every subgroup.

Added By: Artem (DevExpress Support) at: 6/29/2014 11:36:17 PM    

Hello Gustavo,

I've moved your question to a separate thread created on your behalf: 
The E1760 example doesn't select all rows if ASPxGridView is grouped by several columns
Please refer to it for further correspondence.

Added By: Gherda Corrao at: 12/1/2014 3:29:29 AM    

I use 14.1.8 MVC Controls,
how can I select all rows in a group?

Added By: Mike (DevExpress Support) at: 12/1/2014 4:42:10 AM    

Hello Gherda,

To process your recent post more efficiently, I created a separate ticket on your behalf: T180839: E1760 for MVC - How to implement select/unselect for all rows in a group row. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: rushdan . at: 1/20/2015 7:44:15 PM    

Sorry,

I do not understand about this example. Refer to the markup below :

         <Templates>
               <GroupRowContent>
                  <table>
                      <tr><td>
                           <dx:ASPxCheckBox ID="checkBox" runat="server" />
                      </td><td>
                           <dx:ASPxLabel ID="CaptionText" runat="server" Text='<%# GetCaptionText(Container) %>' />
                      </td></tr>
                  </table>
               </GroupRowContent>
           </Templates>

I don't see the ASPxLabel and ASPxCheckBox in the example.

Refer to the markup below, the checkbox only available for ASPxGridView.

<dx:GridViewCommandColumn ShowSelectCheckbox="true" VisibleIndex="0" />

Added By: Vladimir (DevExpress Support) at: 1/20/2015 11:21:49 PM    

Hello,

Since demonstrated controls are placed into the GroupRowContent template, they appear only when ASPxGridView data is grouped by one or several columns. Please group data in the example to see the result.

Added By: dhouha babay 2 at: 3/22/2016 2:26:28 PM    is there some code for razor view engine?

Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>