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

Gridview "Check All" functionality in group rows

5 Answers 20 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nicklas
Top achievements
Rank 1
Veteran
Nicklas asked on 24 Feb 2019, 11:35 AM

Hello, I am currently implenting the "Check All" functionality in group rows. Using this code that I've found here https://www.telerik.com/support/kb/reporting/details/check-all-functionality-in-group-rows

The "Check All" functionality itself works. But it's causing some trouble when I check more than one row individually. The error I'm getting is "The specified change is invalid." And it happens on this line "if ((bool)row.Cells["Include"].Value == false)"

 

Thanks in advance!

5 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Feb 2019, 12:49 PM
Hello, John,         

I have downloaded the provided sample project in the referred KB article and tried to replicate the error you are facing. Everything seems to work as expected on my end. Please refer to the attached gif file illustrating the behavior on my end with the latest version (2019.1 219). Am I missing something? Could you please specify the exact steps how to reproduce the problem?

Off topic, I have deleted the other duplicated forum thread that you have opened.

I am looking forward to your reply.

Regards,
Dess | Tech Support Engineer, Sr.
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
Nicklas
Top achievements
Rank 1
answered on 25 Feb 2019, 10:28 PM

I see. The my application is slightly different than the example, the only diffirence isthe way I populate the grid. First I take the data I want from the backend (datasource is bound to a system.data.datatable) after that I add the checkbox column like below:

            GridViewCheckBoxColumn checkBoxColumn = new GridViewCheckBoxColumn();
            checkBoxColumn.DataType = typeof(int);
            checkBoxColumn.Name = "ChkCol";
            checkBoxColumn.HeaderText = "Include";
            GridProducts.MasterTemplate.Columns.Add(checkBoxColumn);

I can't see how that should be able to affect the behavior, but I realy need some advice. Thanks in advance

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Feb 2019, 08:03 AM
Hello, Nicklas,         

If you add the GridViewCheckBoxColumn programmatically, note that it is important to specify the FieldName property of the column to the respective field in the DataBoundItem. Thus, the values will display in the column only if the value in FieldName is within the range of values provided by the ValueMember field values. As a result the CellValueChanged event will be fired and you check/uncheck the checkbox and the respective field in the DataBoundItem will be properly updated.

However, if you are still experiencing any further difficulties, it would be greatly appreciated if you can submit a support ticket from your account and provide your updated version of the sample project. Thus, our support staff would be able to investigate the precise case and assist you further. Thank you in advance.

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
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
Nicklas
Top achievements
Rank 1
answered on 26 Feb 2019, 12:18 PM
Thanks this solved the problem, however, it would be a very nice to see some more default behavior when it comes to hierarchical and grouped grids. Most of the work when working with those are often custom behavior and takes alot of lines. Anyway thanks :)!
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Feb 2019, 01:02 PM
Hello, Nicklas,         

I am glad that the problem you were facing is now resolved.

As to the custom implementation, your feedback is greatly appreciated. Currently, RadGridView handles the check-all functionality in the header checkbox. For the group rows, this functionality is not designed to be handled. That is why it requires the specified custom implementation.

In case other customers have similar requests, we will consider it in the future improvement of the control.  

If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
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
GridView
Asked by
Nicklas
Top achievements
Rank 1
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Nicklas
Top achievements
Rank 1
Share this question
or