Desktop Grid - Cancel Combobox selectedindexchanged event

Hi

Can we please have e.cancel or something like that, to cancel to selectedindexchange of a combobox in a desktop grid?

Also, could you please implement a functionality to remove a cellcontrol cellwise, at the moment one can remove a control from a column with the help of following statement:

grdDataEntry.Worksheets(0).Columns(0).RemoveCellControl

But, it would remove it from all cells of column, but my requirement is to remove it from some of the cells.


Thanks and Regards
Sukhminder Singh

Hi Sukhminder,

sukhminders:
Can we please have e.cancel or something like that, to cancel to selectedindexchange of a combobox in a desktop grid?

Well, you may protect a cell (GridCell.Protected Boolean attribute) if it suits your need. To show all the values in a combobox but revoke selection on its indexed values, this is what you want. We will check it soon.

sukhminders:
Also, could you please implement a functionality to remove a cellcontrol cellwise, at the moment one can remove a control from a column with the help of following statement:

grdDataEntry.Worksheets(0).Columns(0).RemoveCellControl

But, it would remove it from all cells of column, but my requirement is to remove it from some of the cells.

Well, you may do it. You can remove control from a cell, see the following sample codes:

Dim sheet As Aspose.Grid.Desktop.Worksheet = Me.GridDesktop.GetActiveWorksheet()

Dim cl As CellLocation = sheet.GetFocusedCellLocation()

sheet.Controls.Remove(cl.Row, cl.Column)

'OR

Dim sheet As Aspose.Grid.Desktop.Worksheet = Me.GridDesktop.GetActiveWorksheet()

Dim c As GridCell = sheet.Cells(0, 0)

sheet.Controls.Remove(c.Row, c.Column)


Thank you.

Hi Amjad

Thanks for the answering the second query.

Regarding the first one:


Can we please have e.cancel or something like that, to cancel to selectedindexchange of a combobox in a desktop grid?

Well, you may protect a cell (GridCell.Protected Boolean
attribute) if it suits your need. To show all the values in a combobox
but revoke selection on its indexed values, this is what you want. We
will check it soon.

I know about Protected attribute, if it’s true, then grid does not allow to see the list from the drop down.

But, I want to cancel the selectedindexchanged event as soon as user selects any value from the list of drop down, based on some condition.

Thanks and Regards
Sukhminder Singh

Hi Sukhminder,

Ok, we will check the feasibility against your requested feature if we can implement it. We will get back to you soon.

Thank you.

Hi Sukhminder,

Please try the attached version, we have enhanced the CellSelectedIndexChanged event handler in v2.0.1.8. When the value of the event arguments property named “Handled” is set to true, the control will not accept the new selected value.

Please try the following code:

Private Sub grdDataEntry_CellSelectedIndexChanged(ByVal sender As Object, ByVal e As Aspose.Grid.Desktop.CellComboBoxEventArgs) Handles grdDataEntry.CellSelectedIndexChanged

If e.Row = 3 And e.Column = 0 Then

System.Diagnostics.Debug.WriteLine(e.NewValue)

e.Handled = True

End If

End Sub

Thank you.

The issues you have found earlier (filed as 8731) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.