Telerik.Win.Control.UI.dll version is "2009.3.9.1203"
Hi,
I am running into several behavior problems with the RadGridView control.
1) If I set the BeginEditMode to "BeginEditOnF2", the user is still able to get into edit mode by double-clicking on a cell - not what is expected!
2) once the grid is in edit mode, the user can click on another cell to put it in edit mode regardless of the BeginEditMode setting
3) worst yet, if the user is editing a cell and hit the tab (or shift-tab), the new cell goes into edit mode but the changes to the original cell are not submitted to the bound dataset even though the CellEndEdit event is called (where I update the dataset). Code is below...
Any help would be greatly appreciated...
Ali M.
In the code below, I was forced to ignore the BeginEditMode property because it is not working and instead implemented a CellDoubleClick event handler that puts the cell into edit mode. If the user makes a change and hits the Enter key, then changes are submitted to the db in the CellEndEdit event handler. But, if the user tabs to another cell, the cell is put into Edit mode but the changes he/she made in the previous cell are not submitted...
My preferred solution would be to enforce the F2-only edit mode through the BeginEditMode property...
Hi,
I am running into several behavior problems with the RadGridView control.
1) If I set the BeginEditMode to "BeginEditOnF2", the user is still able to get into edit mode by double-clicking on a cell - not what is expected!
2) once the grid is in edit mode, the user can click on another cell to put it in edit mode regardless of the BeginEditMode setting
3) worst yet, if the user is editing a cell and hit the tab (or shift-tab), the new cell goes into edit mode but the changes to the original cell are not submitted to the bound dataset even though the CellEndEdit event is called (where I update the dataset). Code is below...
Any help would be greatly appreciated...
Ali M.
In the code below, I was forced to ignore the BeginEditMode property because it is not working and instead implemented a CellDoubleClick event handler that puts the cell into edit mode. If the user makes a change and hits the Enter key, then changes are submitted to the db in the CellEndEdit event handler. But, if the user tabs to another cell, the cell is put into Edit mode but the changes he/she made in the previous cell are not submitted...
My preferred solution would be to enforce the F2-only edit mode through the BeginEditMode property...
Public Class RadForm1 |
Private _cellModifyBegin As Boolean |
Private _currentEditCell As Integer |
Private Sub RadForm1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
_cellModifyBegin = False |
Try |
grdCustomers.EnterKeyMode = Telerik.WinControls.UI.RadGridViewEnterKeyMode.None |
Me.CustomerTableAdapter.Fill(Me.CustomerApps.Customer) |
Catch ex1 As System.Exception |
Debug.WriteLine(String.Format("Failed in frmMain2.frmMain2_Load - Exception: {0}", ex1.ToString())) |
My.Application.Log.WriteException(ex1) |
MessageBox.Show(String.Format("An error has ocurred. Message : {0}", ex1.Message())) |
Finally |
Debug.WriteLine("End ---> frmMain2.frmMain2_Load") |
My.Application.Log.WriteEntry(String.Format("End ---> {0:00}:{1:00}:{2:00}:{3:0000} frmMain2.frmMain2_Load", Now.Hour, Now.Minute, Now.Second, Now.Millisecond)) |
End Try |
End Sub |
Private Sub grdCustomers_CellBeginEdit(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellCancelEventArgs) Handles grdCustomers.CellBeginEdit |
Debug.Print(String.Format("grdCustomers_CellBeginEdit. RowIndex={0}, CellIndex={1}", e.RowIndex, e.ColumnIndex)) |
If _currentEditCell <> e.ColumnIndex Then |
' this cell got into Edit mode due to user tabbing away from a previous cell edit |
e.Cancel = True |
Return |
End If |
_cellModifyBegin = True |
End Sub |
Private Sub grdCustomers_CellDoubleClick(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles grdCustomers.CellDoubleClick |
Debug.Print(String.Format("grdCustomers_CellDoubleClick. RowIndex={0}, CellIndex={1}", e.RowIndex, e.ColumnIndex)) |
_currentEditCell = e.ColumnIndex |
e.Row.Cells(e.ColumnIndex).BeginEdit() |
End Sub |
Private Sub grdCustomers_CellEndEdit(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles grdCustomers.CellEndEdit |
If grdCustomers.ActiveEditor.IsModified Then |
Debug.Print(String.Format("grdCustomers_CellEndEdit. RowIndex={0}, CellIndex={1}", e.RowIndex, e.ColumnIndex)) |
CustomerTableAdapter.Update(CustomerApps.Customer) |
grdCustomers.Update() |
End If |
_cellModifyBegin = False |
End Sub |
End Class |