We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Status of Undo and Redo in desktop grid

Hi,

First of all I would like to know the status of Undo and Redo in desktop grid. Secondly, following are my new requests.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Column and Row locking: At the moment we can lock it cell by cell but there is no way to lock a column or row directly.

  1. Hide/Show columns menu in existing Context Menu: How to hide/show columns from front end? I mean is there a way with which user could select a menu and mark a column hidden?
  2. Customize Context Menu: Can we add/remove menus from context menu.
  3. RowFilter: It’s available in web grid, but missing in desktop version:

GridWeb1.WebWorksheets[0].RowFilter.Criteria = "CELL0=\"Revenue\"";
GridWeb1.WebWorksheets[0].RowFilter.FilterRows();

  1. Drag a cell to copy it’s value in following cells: Can I drag a cell downward to get its values in the following cells as we do in Excel?

Kindly provide me an estimated time that will take to implement them. I mean when can we have those features implemented in desktop grid? Also, I can have more requests as I’ll get into more details.

aspose.chart and aspose.cells are the new products that I would like to go with; but firstly I would like to wrap up aspose.grid work. Request you to revert back soon.

thx.

M.Irfan.

Hi Irfan,

We will check if we can provide you an eta for the features, it's really hard at the moment. Actually we got a very busy schedule, we have a long list of features (on hand) to be implemented first. But anyways, for your requests, I would like to share some details:

Column and Row locking: At the moment we can lock it cell by cell but there is no way to lock a column or row directly.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Hopefully we can provide this feature before the end of next week.

  1. Hide/Show columns menu in existing Context Menu: How to hide/show columns from front end? I mean is there a way with which user could select a menu and mark a column hidden?
  2. Customize Context Menu: Can we add/remove menus from context menu.
  3. RowFilter: It’s available in web grid, but missing in desktop version:

GridWeb1.WebWorksheets[0].RowFilter.Criteria = "CELL0=\"Revenue\"";
GridWeb1.WebWorksheets[0].RowFilter.FilterRows();

  1. Drag a cell to copy it’s value in following cells: Can I drag a cell downward to get its values in the following cells as we do in Excel?

Well, we will analyze these features and will get back to you soon.

Thanks for your time and understanding.

Hi Irfan,

We did some work on Undo/Redo and row/column locking features. Hopefully we can provide a version which will support these two features before the end of next week. For Undo/Redo feature, we will provide it in a simple way at the start, it means the Undo/Redo operation refers to the change in a cell’s value only. Other operations i.e.., Change in a cell’s style, cell/row/column removing and other complex operations will not be supported in this version, we will look into them later.

For all other features, we have not planned yet, we may consider them after completing some important tasks (on hand).

Thanks for your time and understanding.

Hi Ifran,

Please try the attached version for Aspose.Grid.Desktop. We have supported the following features for your need.

1) Undo/Redo feature.

The following APIs are incorporated. The descriptions are also given with them, please check.

GridDesktop.EnableUndo attribute ..............indicates whether the Undo function is enabled, the default value is “false”.

UndoManager class ........... is used to manage the undo/redo operations.

GridDesktop.UndoManager attribute..................gets the instance of UndoManager object.

UndoManager.Undo() method ...................performs an undo operation.

UndoManager.Redo() method................. performs the redo operation.

UndoManager.ClearStack() method........... clears the undo and redo stack.

UndoManager.UndoStepsCount attribute ................. gets the count for current available undo steps.

UndoManager.RedoStepsCount attribute...... gets the count for current available redo steps.

UndoManager.UndoStackSize attribute............. gets/sets the undo stack size.

Note: Currently, undo/redo operation refers to the change in a cell value.

2) Row/Column locking

The following code will lock all cells of row 4.

Style s = sheet.Rows[3].GetStyle();

s.CellLocked = true;

sheet.Rows[3].SetStyle(s);

3) Support for Hide/Show columns/rows from Grid's Context Menu.

Thank you.

Hi,

There is another request for the same customer who is looking to Customize
Context Menu
: (Add/Remove menus from context menu): Can you
provide me this feature as well because I need it badly.
thx,
Irfan.<o:p></o:p>

Hi Irfan,

OK, we will look into the feature i.e.., Customize Context Menu

and try to support it before the end of next week or so for your requirements. If we complete the feature we will provide you the supported version.

Thank you.

Hi,

This code locks all cells of a row. What I also need is to lock all cells of a Column. Could you please provide this feature as this also is a very important feature along with Undo/Redo and Custom Menus.

thx.

M.Irfan.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Hi Irfan,

Well, the fix I provided you also supports to lock a complete column.

e.g...,

The following code will lock all the cells of column A.

Style s = sheet.Columns[0].GetStyle();

s.CellLocked = true;

sheet.Columns[0].SetStyle(s);

Thank you.

Hi Amjad,

Any update on redo and undo feature kindly keep us posted soon.

Thanks.

M.Irfan.

Hi Irfan,

We got a very busy schedule these days, we can look into your desired features but after completing some other important tasks on hand. We will keep you updated when you start working on it.

Keep in touch and have a good day!

Hi,<?xml:namespace prefix = o />

We have incorporated the following new features in the attached Aspose.Grid.Desktop version (2.0.0.13). Please try it.

1. Customize Context Menu.

ContextMenuManager class is used to manage the context menu item.

“GridDesktop.ContextMenuManager” attribute gets the instance of ContextMenuManager.

e.g.., “ContextMenuManager.MenuItemAvailable_AddRow” attribute gets or sets a value indicating whether the context menu item "AddRow" is available.

Note: All context menu items have their corresponding “available attributes” in this class.

Sample code:

_gridDesktop.ContextMenuManager.MenuItemAvailable_Paste = false; // disable context menu item “Paste”;

_gridDesktop.ContextMenuManager.MenuItemAvailable_Paste = true; // enable context menu item “Paste”;

By default all the context menu item are all available.

2. Event(s) for Row/column hide/unhide Operations

We have incorporated GridDesktop.RowColumnHiddenChanged event that occurs when the row/column hide status changed.

Sample code:

.............

gridDesktop1.RowColumnHiddenChanged +=

new WorksheetEventHandler(this.hiddenChangeInvokeMethod);

...............

private void hiddenChangeInvokeMethod(object sender, Aspose.Grid.Desktop.WorksheetEventArgs e)

{

string type;

switch(e.SheetEvents)

{

case WorksheetEvents.RowsHide:

type = "rows hide";

break;

case WorksheetEvents.RowsUnHide:

type = "rows Unhide";

break;

case WorksheetEvents.ColumnsHide:

type = "columns hide";

break;

case WorksheetEvents.ColumnsUnHide:

type = "columns Unhide";

break;

default:

return;

}

StringBuilder buf = new StringBuilder();

for(int i=0; i<e.IndexArray.Length; i++)

{

if(i== 0)

buf.Append(e.IndexArray[i]);

else

{

buf.Append(",");

buf.Append(e.IndexArray[i]);

}

}

Console.WriteLine(type);

Console.WriteLine(buf.ToString()); // write out the affected row/column idexes

}

3. The performance of Sort() method (for data sorting feature) has been fixed / enhanced in this version.

Thank you.

Thanks a lot Amjad.


I’ll use/implement them and will get back to you soon with my feedback.

Hi

Could you give me sample code for using Undo and Redo?? Also, is this available in 2.0.13 version?

Hi,

Yes, the feature is incorporated in 2.0.0.13. Please check the description notes for Undo/Redo feature.

The following APIs are incorporated, please check.

GridDesktop.EnableUndo attribute ..............indicates whether the Undo function is enabled, the default value is “false”.

UndoManager class ........... is used to manage the undo/redo operations.

GridDesktop.UndoManager attribute..................gets the instance of UndoManager object.

UndoManager.Undo() method ...................performs an undo operation.

UndoManager.Redo() method................. performs the redo operation.

UndoManager.ClearStack() method........... clears the undo and redo stack.

UndoManager.UndoStepsCount attribute ................. gets the count for current available undo steps.

UndoManager.RedoStepsCount attribute...... gets the count for current available redo steps.

UndoManager.UndoStackSize attribute............. gets/sets the undo stack size.

Note: Currently, undo/redo operation refers to the change in a cell value.

Sample code:

1) Undo:

GridDesktop1.EnableUndo = True

Dim um As UndoManager = GridDesktop1.UndoManager

um.Undo()

2). Redo:

Dim um As UndoManager = GridDesktop1.UndoManager

um.Redo()

Thank you.

OK thanks, I’ll check it out. Another is regarding, Customized Context Menu , I created a menu and assign it to grid’s contextmenustrip’s properties, but it does not show this menu on right click. Could you please tell what could be the issue?

Hi,

My client has implemented aspose.grid in the code. I have to deliver my final release to my client on 22nd of this month.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Following are the issues that I want to get implemented as soon as possible. We have already had a discussion for 2 of them. Could you please revert back soon on the same..

  1. For the following menu items, either there should be an option to hide desired menu items or events should be captured on click of menu item i.e. Add Customized/User defined Context Menu
    1. Hide Column
    2. Unhide Column
    3. Insert Column
    4. Delete Column
    5. Insert Row
    6. Delete Row

Request Reference: http://www.aspose.com/community/forums/150550/desktop-grid-queries-hide-column-add-menu-drag-a-cell/showthread.aspx#150550

  1. Undo/Redo functionality

Request Reference: <A title=https://forum.aspose.com/t/84574

  1. Multi Columns drop downs in grid column.

Request Reference: http://www.aspose.com/community/forums/155059/desktop-grid-gridcolumn.addcombobox/showthread.aspx#155059

  1. Non-consecutive multiple rows selection

Request Reference: http://www.aspose.com/community/forums/153565/desktop-grid-non-consecutive-multiple-rows-selection/showthread.aspx#153565

  1. Change Column index/location programmatically OR from GUI

Request Reference: http://www.aspose.com/community/forums/153573/desktop-grid-change-column-index-location-programmatically/showthread.aspx#153573

This is really very urgent. Kindly update me on them AS SOON AS POSSIBLE.

Thanks,

M.Irfan

Hi,

  1. For the following menu items, either there should be an option to hide desired menu items or events should be captured on click of menu item i.e. Add Customized/User defined Context Menu<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
    1. Hide Column
    2. Unhide Column
    3. Insert Column
    4. Delete Column
    5. Insert Row
    6. Delete Row

i). Well, Hide/unhide desired menu items is supported now. Please see the answer posted on 11-21-2008 in this thread.

ii). We may consider to incorporate “Add Customized/User defined Context Menu” feature in our future versions, currently it is not supported.

iii). a.b.c.d.e.f functions are supported.

  1. Undo/Redo functionality

Request Reference: <A title=https://forum.aspose.com/t/84574

Yes, it is supported. But, Currently only cell value change undo/redo is supported. We may consider enhancing the feature in our future versions.

  1. Multi Columns drop downs in grid column.

Request Reference: http://www.aspose.com/community/forums/155059/desktop-grid-gridcolumn.addcombobox/showthread.aspx#155059

I am afraid this feature is not in accordance with our product structure, so we may not support it in quick time as we have to modify some internal structure/design to some extent. Currently, we have no plan to support it.

  1. Non-consecutive multiple rows selection

Request Reference: http://www.aspose.com/community/forums/153565/desktop-grid-non-consecutive-multiple-rows-selection/showthread.aspx#153565

We may consider enhancing it in our future versions.

  1. Change Column index/location programmatically OR from GUI

I think you may accomplish your need as follows:

  • Insert a new column in the dest location.
  • Copy the old column’s data and style to the new column
  • Delete the old column

Thank you.

Hi,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

The customer can wait for other features. But following 2 are needed badly.

Please confirm if you could provide a beta version for them soon or let us know the time it would take to incorporate this feature..

1. Add Customized/User defined Context Menu

2. Non-consecutive multiple rows selection

Thanks and Regards,

M.Irfan.

Hi Ifran,

We will soon analyze the two features (you have mentioned) and check if we can provide you an eta for the features.

Thank you.

Hi Irfan,

1) Please try the following sample code to add Customized/User defined Context Menu Item for your need:

Sample code:


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Dim gridDesktop1 As GridDesktop = Me.grdDataEntry
Dim sheet As Worksheet = gridDesktop1.GetActiveWorksheet()
sheet.ColumnsCount = 15
sheet.RowsCount = 15
Dim mi As New MenuItem("newMenuItem", New System.EventHandler(AddressOf miClicked))
gridDesktop1.ContextMenu.MenuItems.Add(mi)

End Sub

Private Sub miClicked(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim mi As MenuItem = CType(sender, MenuItem)
MessageBox.Show("miCliked: " & mi.Text)
End Sub

2). Could you tell us why you require "Non-consecutive multiple rows selection" feature? Could you provide us more details about your needs, such as: the operations that will be actually taken after multiple rows were selected. We will analyze the details provided by you if we can implement it for your requirements.

Thank you.