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

Tab Stop behavior in a GridGroupingControl

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


3 Replies

RC Rajadurai C Syncfusion Team December 18, 2008 10:59 AM UTC

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



SK Sameer Khan December 18, 2008 01:30 PM UTC

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.



RC Rajadurai C Syncfusion Team December 20, 2008 07:14 AM UTC

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



Loader.
Live Chat Icon For mobile
Up arrow icon