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

lock a cell in GGC

HI

If the user alters a cell in a GRID GROUPING CONTROL, then he has to click on any of the 4 buttons that i have in my UID.

If user alters and does not click on any of those buttons, he should not be able to move out of the cell.
Cursor has to get locked into that particular cell of GGC, unless he clicks any one of those 4 buttons.

Help me out..

Thanks
pavan




1 Reply

RC Rajadurai C Syncfusion Team September 24, 2010 07:01 PM UTC

Hi Pavan,

Thanks for your interest in Syncfusion Products.

To prevent a cell focus getting moved away after modifying the content until any of the buttons placed in UI is clicked, you can handle the TableControlCurrentCellMoving event with the following code.

// Event Handler
this.gridGroupingControl1.TableControlCurrentCellMoving += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellMovingEventHandler(gridGroupingControl1_TableControlCurrentCellMoving);

// Method Invoked
void gridGroupingControl1_TableControlCurrentCellMoving(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellMovingEventArgs e)
{
if (e.TableControl.CurrentCell.IsModified)
e.Inner.Cancel = true;
}

As the button is placed in UI, the focus can be moved to button from the grid provided the CausesValidation property is set.

Regards,
Rajadurai


Loader.
Live Chat Icon For mobile
Up arrow icon