Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
24741 | Feb 9,2005 09:33 PM UTC | Feb 14,2005 04:02 PM UTC | WinForms | 8 |
![]() |
Tags: GridControl |
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 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.
This page will automatically be redirected to the sign-in page in 10 seconds.