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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GDBG checking all checkboxs in multi selected rows

Thread ID:

Created:

Updated:

Platform:

Replies:

48477 Aug 29,2006 07:06 AM UTC Sep 5,2006 05:01 AM UTC WinForms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 29, 2006 07:06 AM UTC

Hi,

i am using the GDBG with columns bound to a data set, one of the columns is a checkbox. I need to have the ability that when i select more then one row, clicking one of the selected checkboxs will check all the selected checkboxs and not only the clicked cell.

Regards
Tzvika

Administrator [Syncfusion]
Replied On August 29, 2006 10:43 AM UTC

Hi Tzvika,

This can be done through the CurrentCellChanged event of the grid. Here is some code snippet.

// CurrentCellChanged event handler
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
int top = this.gridDataBoundGrid1.Selections.Ranges.ActiveRange.Top;
int bottom = this.gridDataBoundGrid1.Selections.Ranges.ActiveRange.Bottom;

if(this.gridDataBoundGrid1.Selections.Ranges.AnyRangeContains(cc.RangeInfo))
{
if(cc.Renderer.StyleInfo.CellType == "CheckBox")
{
bool check = (bool) cc.Renderer.StyleInfo.CellValue;
if(check)
{
for(int i = top ; i <= bottom ; i++)
{
this.gridDataBoundGrid1.Model[i, cc.ColIndex].CellValue = true;
}
}
}
}

Here is a sample demonstrating this feature.
http://www.syncfusion.com/Support/user/uploads/CheckBoxSample_b750159e.zip

Thanks for using Syncfusion Products.
Regards,
Rajagopal

Administrator [Syncfusion]
Replied On September 5, 2006 05:01 AM UTC

thanks it works perfectly :)

>Hi Tzvika,

This can be done through the CurrentCellChanged event of the grid. Here is some code snippet.

// CurrentCellChanged event handler
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
int top = this.gridDataBoundGrid1.Selections.Ranges.ActiveRange.Top;
int bottom = this.gridDataBoundGrid1.Selections.Ranges.ActiveRange.Bottom;

if(this.gridDataBoundGrid1.Selections.Ranges.AnyRangeContains(cc.RangeInfo))
{
if(cc.Renderer.StyleInfo.CellType == "CheckBox")
{
bool check = (bool) cc.Renderer.StyleInfo.CellValue;
if(check)
{
for(int i = top ; i <= bottom ; i++)
{
this.gridDataBoundGrid1.Model[i, cc.ColIndex].CellValue = true;
}
}
}
}

Here is a sample demonstrating this feature.
http://www.syncfusion.com/Support/user/uploads/CheckBoxSample_b750159e.zip

Thanks for using Syncfusion Products.
Regards,
Rajagopal

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

;