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
close icon

QueryCellStyleInfo & TableControlCurrentCellAcceptedChanges

I am trying to disable two cells during addnewrecord. However, when I tab from the cell adjacent to a disabled cell the program hangs.
I am using querycellstyleinfo to disable the cells and tablecontrolcurrentcellacceptedchanges to gather information in my local object. I am using a gridgroupingcontrol and syncfusion ver 4.202.0.51.

I have attached an example program.
Enter data in cell d1 hit tab works fine.
Enter data in d2 hit tab and it hangs.



Help.

Thanks

Ray.

newrecorddisabletwocells.zip

1 Reply

HA haneefm Syncfusion Team July 3, 2007 06:20 PM UTC

Hi Ray,

You can handle the TableControlCurrentCellKeyDown event of the grid and move the current cell to required position by using the record.SetCurrent method when the TAB key is pressed. Below are the code snippet.

void _Grid_TableControlCurrentCellKeyDown(object sender, GridTableControlKeyEventArgs e)
{
if (e.Inner.KeyCode == Keys.Tab)
{
int row = e.TableControl.CurrentCell.RowIndex, col = e.TableControl.CurrentCell.ColIndex;
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(row, col );
Record rec = style.TableCellIdentity.DisplayElement.GetRecord();
if ( rec != null && style.TableCellIdentity.Column != null && style.TableCellIdentity.Column.Name == "d2")
{
e.Inner.Handled = true;
rec.SetCurrent("object");
}

}
}

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon