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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Check box for row selection in grid grouping control

Thread ID:

Created:

Updated:

Platform:

Replies:

105749 Nov 19,2012 06:09 AM UTC Jul 9,2015 07:16 AM UTC WinForms 9
loading
Tags: GridControl
Inder Jeet Pal Singh
Asked On November 19, 2012 06:09 AM UTC

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


Vinish Kumar K [Syncfusion]
Replied On 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

Jonathan R Bolton
Replied On 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.

Vinish Kumar K [Syncfusion]
Replied On 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.

 


Administrator [Syncfusion]
Replied On 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?

Pierre Smith
Replied On 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.

Anish George [Syncfusion]
Replied On 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.


Anish George [Syncfusion]
Replied On 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


Pierre Smith
Replied On 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

Anish George [Syncfusion]
Replied On July 9, 2015 07:16 AM UTC

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;