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.

How to delete a record from data grid

Thread ID:

Created:

Updated:

Platform:

Replies:

53609 Dec 16,2006 08:10 AM Dec 18,2006 03:35 AM Windows Forms 1
loading
Tags: Grouping
Mgs4solidsnake
Asked On December 16, 2006 08:10 AM

Hi Every one, i wanted to delete a record from grid when i press a specific key like DELETE , I have initialized KeyDown Event of grid but when i click any key it doesn,t fire the event , How Can i Do This, Thanks.

Regards,

Mgs4solidsnake

Administrator [Syncfusion]
Replied On December 18, 2006 03:35 AM

Hi Mgs4solidsnake,

You can achieve the intended behavior by handling the TableControlCurrentCellKeyDown event. This event will be triggered for key down in the cell.

The reason for the grid’s KeyDown event is not being triggered because the key down ( Delete, Shift etc ) has been handled by current cell.

>>>>>>>>>>>>>>>
//this.gridGroupingControl1.TableControlCurrentCellKeyDown += new GridTableControlKeyEventHandler(gridGroupingControl1_TableControlCurrentCellKeyDown);
private void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, GridTableControlKeyEventArgs e)
{
if(e.Inner.KeyCode == Keys.Delete)
{
this.gridGroupingControl1.Table.CurrentRecord.Delete();
e.Inner.Handled = true;
}
}
>>>>>>>>>>>>>>>

Kindly let us know if you need any further assistance.
Have a nice day.

Best regards,
Madhan

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.

;