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.
Unfortunately, activation email could not send to your email. Please try again.

Ctrl + A

Thread ID:

Created:

Updated:

Platform:

Replies:

73001 Apr 15,2008 12:56 PM Jun 4,2008 05:26 AM Windows Forms 4
loading
Tags: GridControl
Qingde Shi
Asked On April 15, 2008 12:56 PM

Hi,

I am wondering how to intercept the event when user pressed Ctrl + A to select all, and customized the event to exclude column, row headers and any hidden columns?

Thanks,

Q


Johnson [Syncfusion]
Replied On April 18, 2008 05:27 PM

Hi Q,

To copy a Grid without Row header and column header when Press Ctrl+A and Ctrl+C, you need to set the below properties.

this.gridControl1.CutPaste.ClipboardFlags &= ~GridDragDropFlags.ColHeader;
this.gridControl1.CutPaste.ClipboardFlags &= ~GridDragDropFlags.RowHeader;

Below minimal sample shows how to copy a Grid without hidden columns. Please refer the sample for implementation.

Sample:

http://websamples.syncfusion.com/Samples/Grid.Windows/F73001/main.htm



Please let me know if you need further assistance.

Best regards,
Johnson



Qingde Shi
Replied On May 8, 2008 10:32 AM

Hi Johnson,

Thanks.

I can not open the link below. Could you please check if the link is still valid?

in addtion, in virtual mode, when pressing Ctrl + A, you can see that cell being selected one by one, row by row. it is a bit slow. I am guessing this resulted from when selecting one cell, it causes the grid to refresh and query cell events, so when selecting all, every cell causes at least one round refreshing. Is this understanding correct? if so, how to avoid? if not, what might be the reason for such behavior?

Thanks,

Q



>Hi Q,

To copy a Grid without Row header and column header when Press Ctrl+A and Ctrl+C, you need to set the below properties.

this.gridControl1.CutPaste.ClipboardFlags &= ~GridDragDropFlags.ColHeader;
this.gridControl1.CutPaste.ClipboardFlags &= ~GridDragDropFlags.RowHeader;

Below minimal sample shows how to copy a Grid without hidden columns. Please refer the sample for implementation.

Sample:

http://websamples.syncfusion.com/Samples/Grid.Windows/F73001/main.htm



Please let me know if you need further assistance.

Best regards,
Johnson





Qingde Shi
Replied On May 13, 2008 01:45 PM

Hi,

I am still trying to get some answers on this subject.

Thanks.

Q

>Hi Johnson,

Thanks.

I can not open the link below. Could you please check if the link is still valid?

in addtion, in virtual mode, when pressing Ctrl + A, you can see that cell being selected one by one, row by row. it is a bit slow. I am guessing this resulted from when selecting one cell, it causes the grid to refresh and query cell events, so when selecting all, every cell causes at least one round refreshing. Is this understanding correct? if so, how to avoid? if not, what might be the reason for such behavior?

Thanks,

Q



>Hi Q,

To copy a Grid without Row header and column header when Press Ctrl+A and Ctrl+C, you need to set the below properties.

this.gridControl1.CutPaste.ClipboardFlags &= ~GridDragDropFlags.ColHeader;
this.gridControl1.CutPaste.ClipboardFlags &= ~GridDragDropFlags.RowHeader;

Below minimal sample shows how to copy a Grid without hidden columns. Please refer the sample for implementation.

Sample:

http://websamples.syncfusion.com/Samples/Grid.Windows/F73001/main.htm



Please let me know if you need further assistance.

Best regards,
Johnson







Sri Rajan [Syncfusion]
Replied On June 4, 2008 05:26 AM

Hi Q,

Thank you for your patience.

Please try the code below to select all the cells in a GridControl or a virtual Grid except row and column headers.

void gridControl1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.A && e.Control)
{
int rc = this.gridControl1.Model.RowCount;
int cc = this.gridControl1.Model.ColCount;
this.gridControl1.Model.Selections.Add(GridRangeInfo.Cells(1, 1, rc, cc));
}
}


Please let me know if this helps.

Best Regards,
Srirajan


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.

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.

;