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

Get count of checked checkboxes

5 Answers 278 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Timothy
Top achievements
Rank 1
Timothy asked on 31 Oct 2010, 09:03 AM
I have a grid that gets populated from a datasource. The grid consists of appoximately 100 rows and about 20 columns. A vast majority (100s) of these rows are populated with Checkboxes in the cells for each column. I need to be able to display the total # of checked check boxes in the grid.

How can I retrieve the total count of checked checkboxes in a grid on the client side.

Thanks you,
Tim

5 Answers, 1 is accepted

Sort by
0
Timothy
Top achievements
Rank 1
answered on 31 Oct 2010, 09:55 AM
I guess another way to approach this would be to get a total count of all cells in the datagrid with a value of "1". I need help to figure out how to retrieve this count.

I could not figure out how to do it in a SQL query so I started digging into what can be done within the code.

Thanks,
Tim
0
Timothy
Top achievements
Rank 1
answered on 01 Nov 2010, 07:36 AM
Please help me with this. If anyone has any information  that may be useful.
0
Maya
Telerik team
answered on 01 Nov 2010, 08:35 AM
Hello Timothy,

As the best approach is work directly with the data, not with the visual elements, it is better if all the CheckBox-es are bound to Properties and you count the number of "True"/ "False" values.You may get access to all the items of the grid through its Items collection. 
Let me know if you need any further assistance.
 

All the best,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Timothy
Top achievements
Rank 1
answered on 01 Nov 2010, 10:00 AM
Can you please provide an example project for reference? I would be forever grateful.

Thank you,
Tim
0
Accepted
Maya
Telerik team
answered on 02 Nov 2010, 10:32 AM
Hi Timothy,

I am sending you a sample project illustrating the proposed solution.
 

All the best,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Timothy
Top achievements
Rank 1
Answers by
Timothy
Top achievements
Rank 1
Maya
Telerik team
Share this question
or