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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

delete entire row, undo

Thread ID:

Created:

Updated:

Platform:

Replies:

103301 Apr 19,2012 10:52 PM UTC Apr 24,2012 10:30 AM UTC WinForms 1
loading
Tags: GridControl
Smitha
Asked On April 19, 2012 10:52 PM UTC


While trying to delete cells, rows in the syncfusion grid control for windows forms,
here is a part of my code
if (list.Count > 0)
{
int selectedRowTop = list.ActiveRange.Top;
int selectedRowBottom = list.ActiveRange.Bottom;
int selectedColumnLeft = list.ActiveRange.Left;
int selectedColumnRight = list.ActiveRange.Right;

thegrid.removerange(.....)
This works well for the user selcts a range of cell.
Suppose the user selects an entire row, then selectedColumnLeft , selectedColumnRight are coming to be 0
How should I delete an entire row?

2) Please send me some sample code for undo functionality




Jeya Preetha M [Syncfusion]
Replied On April 24, 2012 10:30 AM UTC

Hi Smitha,

Thank You for your interest in Syncfusion Products.

To delete an entire row in the Grid Control, please set "selectedColumnLeft=0" and "selectedColumnRight=e.colcount".


GridRangeInfo range = GridRangeInfo.Cells(top, 0, bottom, e.colcount);


To enable Undo/Redo for the current cell in the Grid Control , please try the following code snippet.

this.gridControl1.CommandStack.Enabled = true;

private void gridControl1_CurrentCellKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Z && e.Control))
{
if (this.gridControl1.CurrentCell.IsEditing)
{
this.gridControl1.CurrentCell.EndEdit();
this.gridControl1.CommandStack.Undo();
}
}
}



Please let me know if you have any concerns.

Regards,
Jeya Preetha M



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.

Warning Icon 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.Close Icon

;