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

Adding selecting checkbox into GroupHeaderItem

4 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jan
Top achievements
Rank 1
jan asked on 11 Aug 2008, 07:26 PM
Hello,

 I was trying to implement radgrid with grouping and with client side selecting of all items in group after checking header of group. So I was wandering if there is some way how to implement this behavior easily.
 Is there any template for GroupHeaderItem so that I can add GridClientSelectColum in it, or something like this?

Thank you
Jan

4 Answers, 1 is accepted

Sort by
0
jan
Top achievements
Rank 1
answered on 11 Aug 2008, 10:24 PM

Maybe I will specify it a little bit:

 I am able to access content of group header (through DataCell.Text property) and insert here HTML which will be interpreted as a checkbox, like this:

 item.DataCell.Text = "Sellect ALL <input id='RadGridXX_groupYYSelectCheckBox' type='checkbox' name='RadGridXX_groupYYSelectCheckBox' onclick='window[&quot;RadGridXX&quot;].SelectAllRows(&quot;RadGridXX&quot;, &quot;-1&quot;, event);' />"

This will select all rows of course. Is there some way how to call SelectAllRows javascript function so that it select only the rows in one group? Or is there a way how to find out a number of rows in one group during itemDataBound, so that SelectAllRows could be replaced with multiple selectRow function calls?

Thank you
0
Shinu
Top achievements
Rank 2
answered on 12 Aug 2008, 07:20 AM
Hi Jan,

Have a look at the following code library submission and see whether it is helpful.
Selecting all items in a group with a checkbox in the group header item

Thanks
Shinu.
0
jan
Top achievements
Rank 1
answered on 12 Aug 2008, 05:06 PM

Hi,

Thank you for supplied example. But it still needs the server for selecting. But I already solve this on client side with javascript function SelectRow and adding a checkbox to header by inserting the HTML code (

groupHeaderItem.DataCell.Text += "<input id='xx' type='checkbox' onclick='mySelectFunc()' />"

)

Thanks
Jan

0
Mike
Top achievements
Rank 1
answered on 19 Nov 2008, 02:12 PM
Jan,

I am trying do so the same thing, is that all the code you added to get it to work?  What is your mySelectFunc doing?  Could you please supply a full example?  Thanks!
Tags
Grid
Asked by
jan
Top achievements
Rank 1
Answers by
jan
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Mike
Top achievements
Rank 1
Share this question
or