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.

Tab Stop behavior in a GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

78547 Dec 17,2008 02:55 PM Dec 20,2008 02:14 AM Windows Forms 3
loading
Tags: GridControl
Sameer Khan
Asked On December 17, 2008 02:55 PM

Is there a way to control the tab stop for individual columns in a GridGroupingControl


Rajadurai C [Syncfusion]
Replied On December 18, 2008 05:59 AM

Hi Sameer,

Thanks for your interest in Syncfusion products.

Please try handling the TableControlCurrentCellKeyDown event with the following code snippet. This prevents the tabbing to the column2 in gridgroupingcontrol.

private void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, GridTableControlKeyEventArgs e)
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
if (e.Inner.Shift == false && e.Inner.KeyCode == Keys.Tab && cc.ColIndex == 1)
{
e.Inner.Handled = true;
cc.MoveTo(cc.RowIndex, cc.ColIndex +2);
}
else if (e.Inner.Shift == true && e.Inner.KeyCode == Keys.Tab && cc.ColIndex == 3)
{
e.Inner.Handled = true;
cc.MoveTo(cc.RowIndex, cc.ColIndex - 2);
}
}


Regards,
Rajadurai


Sameer Khan
Replied On December 18, 2008 08:30 AM

Thank you for the response; but this does not answer my question.

I was looking for a way to control the tab stops, since these columns can be re-arranged, and indexes are never a good thing.

Also, when I am programatically changing the index around [using move to], I might land in a cell which needs to have it's tab stob disabled.

I could get around all of this [I guess] by making the columns disabled. But was hoping that there would be some property on the column itself.


Rajadurai C [Syncfusion]
Replied On December 20, 2008 02:14 AM

Hi Sameer,

Sorry for the inconvenience caused.

If column reordering has to be done, then you can make use of HeaderText property instead of column index. Please try the following code snippet.

void TableControl_CurrentCellKeyDown(object sender, KeyEventArgs e)
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
if (e.Shift == false && e.KeyCode == Keys.Tab && cc.Renderer is GridTextBoxCellRenderer )
{
if (cc.ColIndex < this.gridGroupingControl1.TableDescriptor .Columns .Count)
{
if (this.gridGroupingControl1.TableDescriptor.Columns[cc.ColIndex].HeaderText == "CustomerName")
{
cc.MoveTo(cc.RowIndex, cc.ColIndex + 1);
}
}
}
}


Regards,
Rajadurai



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.

;