AD
Administrator
Syncfusion Team
February 10, 2005 04:52 PM UTC
I thought a sample might help. Just run this and do a range selection starting by clicking in cell 1,1 and then dragging down in col1 to like row 5. then hit the delete key. in 2050 and how we think it should work this would delete all the cells via the clearing cells event. in 3010 it just takes the first cell in to active edit mode. i know you''ve had problems with this before with copy and pasting a range of cells and it doing the same thing of putting one in active edit mode
AD
Administrator
Syncfusion Team
February 10, 2005 04:54 PM UTC
I thought a sample might help. Just run this and do a range selection starting by clicking in cell 1,1 and then dragging down in col1 to like row 5. then hit the delete key. in 2050 and how we think it should work this would delete all the cells via the clearing cells event. in 3010 it just takes the first cell in to active edit mode. i know you''ve had problems with this before with copy and pasting a range of cells and it doing the same thing of putting one in active edit mode. ok the attachment button isnt bringing up the window so i will email the sample like i''ve done in the past. thanks
AD
Administrator
Syncfusion Team
February 10, 2005 11:52 PM UTC
Phil,
thanks for the sample. We will look into this.
Stefan
>I thought a sample might help. Just run this and do a range selection starting by clicking in cell 1,1 and then dragging down in col1 to like row 5. then hit the delete key. in 2050 and how we think it should work this would delete all the cells via the clearing cells event. in 3010 it just takes the first cell in to active edit mode. i know you''ve had problems with this before with copy and pasting a range of cells and it doing the same thing of putting one in active edit mode. ok the attachment button isnt bringing up the window so i will email the sample like i''ve done in the past. thanks
AD
Administrator
Syncfusion Team
February 11, 2005 03:11 PM UTC
Phil,
we saw the problem in your sample and fixed it in our code base.
With this latest code you also have the option then to override the following methods and decide whether "0" or empty value should be set for these cells.
Private Sub grdCB_RCPA_ClearingCells(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridClearingCellsEventArgs) Handles grdCB_RCPA.ClearingCells
'' Do text based clear by calling style.FormattedText on each cell.
e.ClearStyle = False
End Sub
Private Sub grdCB_RCPA_SaveCellFormattedText(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridCellTextEventArgs) Handles grdCB_RCPA.SaveCellFormattedText
'' Default is to clear out cells - but you can also assign "0" if you want to
If (e.Text = "") Then
e.Style.CellValue = 0
e.Handled = True
End If
End Sub
Private Sub grdCB_RCPA_CurrentCellDeleting(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles grdCB_RCPA.CurrentCellDeleting
Dim grid As GridControlBase = sender
'' either clear out cell
grid.Model(grid.CurrentCell.RowIndex, grid.CurrentCell.ColIndex).CellValue = DBNull.Value
'' or assign 0 and switch into edit mode
grid.CurrentCell.BeginEdit()
grid.CurrentCell.Renderer.ControlText = "0"
e.Cancel = True
End Sub
Stefan
>Phil,
>
>thanks for the sample. We will look into this.
>
>Stefan
>
>>I thought a sample might help. Just run this and do a range selection starting by clicking in cell 1,1 and then dragging down in col1 to like row 5. then hit the delete key. in 2050 and how we think it should work this would delete all the cells via the clearing cells event. in 3010 it just takes the first cell in to active edit mode. i know you''ve had problems with this before with copy and pasting a range of cells and it doing the same thing of putting one in active edit mode. ok the attachment button isnt bringing up the window so i will email the sample like i''ve done in the past. thanks
AD
Administrator
Syncfusion Team
February 11, 2005 04:01 PM UTC
Will this be available in the 3.1 version coming out? The reason we use the clearing cell routines is because we originally used your null value and set it to zero in the editor under the currency option and that worked up until you guys went to like version 2 i think it was and then it stopped working and would blow up all our forms because it wasnt putting a zero in the cellvalue field like it did in the old version. i had a huge direct trac open with jay about it and he said you changed it for mainly for people using data bound grids which we dont and thats how it was going to work from now on and that it basically was never working right when it was working right for us. so we had to change all of our forms to do are zeroing in the clearing cells. thats why we use it if you wondered.
AD
Administrator
Syncfusion Team
February 11, 2005 08:21 PM UTC
No default behavior is changed. The event handlers I gave are just alternatives for the ClearingCells you have.
Stefan
>Will this be available in the 3.1 version coming out? The reason we use the clearing cell routines is because we originally used your null value and set it to zero in the editor under the currency option and that worked up until you guys went to like version 2 i think it was and then it stopped working and would blow up all our forms because it wasnt putting a zero in the cellvalue field like it did in the old version. i had a huge direct trac open with jay about it and he said you changed it for mainly for people using data bound grids which we dont and thats how it was going to work from now on and that it basically was never working right when it was working right for us. so we had to change all of our forms to do are zeroing in the clearing cells. thats why we use it if you wondered.
AD
Administrator
Syncfusion Team
February 14, 2005 03:44 PM UTC
will this be in the 3.1 thats suppose to be coming out soon?
AD
Administrator
Syncfusion Team
February 14, 2005 04:02 PM UTC
Yes. Changes are checked in.
Stefan
>will this be in the 3.1 thats suppose to be coming out soon?