Hi,
if I try to cancel a delete action in the RadGridView, I got a execption error.
The problem appear in the Option dialog of the radRibbon. In this dialog I got a radGridview, if something are deleted, I check if I can delete it. If not a set the e.cancel = true. If e.cancel=true the system give me this error:
I try to use e.cancel=true in the validating event and all work good. I have trouble only in the deleting event.
The exception are on the line: opt.ShowDialog()
here the deleting function:
any suggestion?
if I try to cancel a delete action in the RadGridView, I got a execption error.
The problem appear in the Option dialog of the radRibbon. In this dialog I got a radGridview, if something are deleted, I check if I can delete it. If not a set the e.cancel = true. If e.cancel=true the system give me this error:
System.ArgumentOutOfRangeException was unhandled |
Message="L'index était hors limites. Il ne doit pas être négatif et doit être inférieur à la taille de la collection. Nom du paramètre : index" |
ParamName="index" |
Source="mscorlib" |
StackTrace: |
à System.Collections.ArrayList.get_Item(Int32 index) à Telerik.WinControls.UI.GridViewInfo.DeleteRow(GridViewDataRowInfo[] rows) à Telerik.WinControls.UI.GridTableBodyElement.ProcessCmdKey(Keys keyData) à Telerik.WinControls.UI.RadGridView.ProcessCmdKey(Message& msg, Keys keyData) à System.Windows.Forms.Control.PreProcessMessage(Message& msg) à System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg) à System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg) à System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg) à System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) à System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) à System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) à System.Windows.Forms.Form.ShowDialog(IWin32Window owner) à System.Windows.Forms.Form.ShowDialog() à Progest.ProgestVB.frmMain.RadRibbonBar1_OptionsButton_Click(Object sender, EventArgs e) dans C:\DotNet_WS\Progest\Dev\Progest\Forms\frmMain.vb:ligne 191 à System.EventHandler.Invoke(Object sender, EventArgs e) à Telerik.WinControls.RadItem.OnClick(EventArgs e) à Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e) à Telerik.WinControls.RadItem.DoClick(EventArgs e) à Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args) à Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args) à Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args) à Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args) à Telerik.WinControls.RadElement.DoMouseDown(MouseEventArgs e) à Telerik.WinControls.RadControl.OnMouseDown(MouseEventArgs e) à System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) à System.Windows.Forms.Control.WndProc(Message& m) à System.Windows.Forms.ScrollableControl.WndProc(Message& m) à Telerik.WinControls.RadControl.WndProc(Message& m) à Telerik.WinControls.UI.RadPopupControl.WndProc(Message& m) à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) à System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) à System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) à System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) à System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) à System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) à System.Windows.Forms.Application.Run(Form mainForm) à Progest.ProgestVB.Program.Main(String[] args) dans C:\DotNet_WS\Progest\Dev\Progest\Main.vb:ligne 17 à System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) à System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() à System.Threading.ThreadHelper.ThreadStart_Context(Object state) à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) à System.Threading.ThreadHelper.ThreadStart() |
InnerException: |
I try to use e.cancel=true in the validating event and all work good. I have trouble only in the deleting event.
The exception are on the line: opt.ShowDialog()
Private Sub RadRibbonBar1_OptionsButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadRibbonBar1.OptionsButton.Click |
Dim Opt As New dlgOptions |
Opt.ShowDialog() |
Opt.Dispose() |
End Sub |
here the deleting function:
Private Sub RadGridSegments_RowDeleting(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.RowDeletingEventArgs) Handles RadGridSegments.RowDeleting |
If oSegment.PeutEffacer(e.Row.Cells("ID").Value) = False Then |
MessageBox.Show(RM.GetString("dlgConfig_EffSegment"), "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) |
e.Cancel = True |
End If |
End Sub |
any suggestion?