We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Check box for row selection in grid grouping control

Hi,
My user has requested me to have check box as my first column in my grid grouping control grid and he should be able to select or select rows based on whether check box is selected or deselected.
I also want a select All/ Deselect All button on the header.
 
Do you sample code/link to acheive this?
Thanks
Inder


9 Replies

VK Vinish Kumar K Syncfusion Team November 19, 2012 06:20 AM UTC

Hi Inder,

 

Thank you for your interest in Syncfusion.

 

 

Query.

 

Select a record based on checkbox click

We have analyzed your query and we have implemented all things in the sample. In this sample will provide a solution for you query.

 

If you click the checkbox then selected record is highlighted and shown in next grid.

 

Please refer the attached sample.

Here is the video file for reference : http://www.syncfusion.com/downloads/Support/DirectTrac/99884/99884_Video-783911365.zip

Please let me know if you have further concerns.

Regards,

Vinish.



F105504_Order1042529201_e91f4c61_24f9b33d.zip


JR Jonathan R Bolton November 21, 2012 06:31 PM UTC

I am attaching to this forum post.  Your examples do not show the second part of the original requester's request.  Besides adding a check box to a GGC (demonstrated very well by your example), the requester also would like a header cell check box that has a "Select All/Deselect All" function.  If you can enhance sample 99886_Order that would be most helpful.


VK Vinish Kumar K Syncfusion Team December 19, 2012 02:31 AM UTC

Hi Jonathan,

 

Sorry for the inconvenience caused with delay.

 

Query:

Having CheckBox in the Header of GridGroupingControl.

Now the Selection/De-selection made in the HeaderCheckBox will reflect in the corresponding column’s checkboxes. We have implemented this in attached sample  also.

 

Please refer to the following code snippet and modified sample file.

 

Code: 

void gridGroupingControl1_TableControlCellClick(object sender,GridTableControlCellClickEventArgs e)

{

GridTableCellStyleInfoIdentity id = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex).CellIdentity as GridTableCellStyleInfoIdentity;

if (id.Column != null && id.Column.Name == "Add Item" && id.TableCellType ==GridTableCellType.ColumnHeaderCell)

{

   checkBoxValue = !checkBoxValue;

   foreach (Record rec in e.TableControl.Table.Records)

   {               

     rec.SetValue("Add Item", checkBoxValue);

   }

}

}

 

Sample file : http://www.syncfusion.com/downloads/Support/DirectTrac/102225/GGC%20Header%20CheckBox-1629330622.zip

 

Please let me know if you have further concerns.

 

Regards,

Vinish.

 



AD Administrator Syncfusion Team June 4, 2013 07:09 PM UTC

I cannot get the link to the code to work.  This is true of many links in the forum site and is a cause for frustration with the forums.
 
Any chance you can repost this sample?


PS Pierre Smith June 19, 2015 06:05 PM UTC

Hi Guys

I would really like to get the code for this . I want to implement a solution where the customer can click the rows to select them . The links on this post is not working can someone please repost or post the code maybe or an explanation of how to implement the checkbox select option.


AG Anish George Syncfusion Team June 22, 2015 01:02 PM UTC

Hi Pierre,


Thank you for your interest in Syncfusion products.


Please make use of the below sample.


Sample:

http://www.syncfusion.com/downloads/support/directtrac/general/CS900373529.zip


Please let us know if you need any further assistance.


Regards,
Anish.



AG Anish George Syncfusion Team June 22, 2015 02:36 PM UTC

Hi Pierre,


Sorry for the inconvenience. Please ignore our previous update.

We suggest you to use the TableControlCheckBoxClick event and make use of the below code for selection. We have also created a sample for your convenience.

                          

C#:

void gridGroupingControl1_TableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e)

{

GridTableCellStyleInfo style = (GridTableCellStyleInfo)e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);

Record currentRecord = style.TableCellIdentity.DisplayElement.GetRecord();

if (this.gridGroupingControl1.TableModel[e.Inner.RowIndex, e.Inner.ColIndex].Text == "False")

currentRecord.SetSelected(true);

else

currentRecord.SetSelected(false);

}


Sample:
http://www.syncfusion.com/downloads/support/forum/105749/ze/CS1566249275

Please let us know if you need any further assistance.

Regards,
Anish



PS Pierre Smith July 8, 2015 05:22 AM UTC

Thank you Anish

I am going to take a look at the code and the samples right now and give you feedback on if i got it right or not

Regards
Pierre


AG Anish George Syncfusion Team July 9, 2015 07:16 AM UTC

Hi Pierre,
 
Thank you for your update.
 
We will wait until we hear from you.
 
Regards,
Anish.

Loader.
Live Chat Icon For mobile
Up arrow icon