This is a migrated thread and some comments may be shown as answers.

Getting Error while selecting item from Grid Dropdownlist

2 Answers 95 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rajesh
Top achievements
Rank 1
Rajesh asked on 23 Apr 2012, 11:19 AM
Hi,

I am getting an error(see attached files) while trying to select item from grid dropdownlist.
Step to reproduce:
1. This is occuring when we trying to select an item from dropdownlist very fast e.g 
    - Click on add new row or click on dropdown cell and press B as I have item starting from B and then click outside of the row(somewhere in grid) do it repeatatively.Try to repeat the steps as fast as possible.
2.After few rows added you will get attached error which is not going inside try and catch.

I am using below grid events:
1.

 

Private Sub rdgrdvSeachAddUpt_CellBeginEdit(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.GridViewCellCancelEventArgs) Handles rdgrdvSeachAddUpt.CellBeginEdit

 

 

Dim lobjMessage As New Message

 

 

Try

 

 

''Find out dropdown control in Grid

 

 

Dim editor = TryCast(e.ActiveEditor, RadDropDownListEditor)

 

 

If editor IsNot Nothing Then

 

 

''If yes find out its element

 

 

Dim editorElement = TryCast(editor.EditorElement, RadDropDownListEditorElement)

 

 

If editorElement IsNot Nothing Then

 

 

''If its column name is radcmbCriteriaType

 

 

If e.Column.Name = "radcmbCriteriaType" Then

 

 

''Add handler to get dropdown event

 

 

AddHandler editorElement.SelectedIndexChanged, AddressOf editorElement_SelectedIndexChanged

 

 

End If

 

 

End If

 

 

End If

 


2.rdgrdvSeachAddUpt_CellEndEdit
3.rdgrdvSeachAddUpt_CellValueChanged
4.rdgrdvSeachAddUpt_Click
5.rdgrdvSeachAddUpt_UserDeletingRow

===See below as i WAS not able to attched files

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Telerik.WinControls.Data.RadListSource`1.get_Item(Int32 index)
   at Telerik.WinControls.Data.RadCollectionView`1.get_Item(Int32 index)
   at Telerik.WinControls.UI.RadListDataItemCollection.get_Item(Int32 index)
   at Telerik.WinControls.UI.RadListElement.FindStringNonWrapping(String s, Int32 startIndex)
   at Telerik.WinControls.UI.RadListElement.ProcessKeyboardSearch(Char character)
   at Telerik.WinControls.UI.RadDropDownListElement.ProccesListFastNavigationInDropDownListMode(Char pressedChar)
   at Telerik.WinControls.UI.RadDropDownListElement.OnKeyPress(RadDropDownListEditableAreaElement sender, KeyPressEventArgs e)
   at Telerik.WinControls.UI.RadDropDownListElement.NotifyOwner(PopupEditorNotificationData notificationData)
   at Telerik.WinControls.UI.RadDropDownListEditableAreaElement.textBox_KeyPress(Object sender, KeyPressEventArgs e)
   at Telerik.WinControls.RadItem.OnKeyPress(KeyPressEventArgs e)
   at Telerik.WinControls.RadItem.DoKeyPress(KeyPressEventArgs e)
   at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
   at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
   at Telerik.WinControls.RadItem.RaiseKeyPress(KeyPressEventArgs e)
   at Telerik.WinControls.ComponentInputBehavior.OnKeyPress(KeyPressEventArgs e)
   at Telerik.WinControls.RadControl.OnKeyPress(KeyPressEventArgs e)
   at Telerik.WinControls.UI.RadGridView.OnKeyPress(KeyPressEventArgs e)
   at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
   at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
   at System.Windows.Forms.Control.WmKeyChar(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at Telerik.WinControls.RadControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3625 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
QECGWindows
    Assembly Version: 2.6.0.6
    Win32 Version: 02.06.000.006
    CodeBase: file:///D:/ECGDEV/Development%202.4/QECGWindows/QECGGUI/bin/Debug/QECGWindows.exe
----------------------------------------
Quintiles.ECG.UI.Infrastructure
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/ECGDEV/Development%202.4/QECGWindows/QECGGUI/bin/Debug/Quintiles.ECG.UI.Infrastructure.DLL
----------------------------------------
Microsoft.Practices.CompositeUI.WinForms
    Assembly Version: 1.0.51205.0
    Win32 Version: 1.0.51205.0
    CodeBase: file:///D:/ECGDEV/Development%202.4/QECGWindows/QECGGUI/bin/Debug/Microsoft.Practices.CompositeUI.WinForms.DLL
----------------------------------------
Microsoft.Practices.CompositeUI
    Assembly Version: 1.0.51205.0
    Win32 Version: 1.0.51205.0
    CodeBase: file:///D:/ECGDEV/Development%202.4/QECGWindows/QECGGUI/bin/Debug/Microsoft.Practices.CompositeUI.DLL
----------------------------------------
Microsoft.Practices.ObjectBuilder
    Assembly Version: 1.0.51206.0
    Win32 Version: 1.0.51206.0
    CodeBase: file:///D:/ECGDEV/Development%202.4/QECGWindows/QECGGUI/bin/Debug/Microsoft.Practices.ObjectBuilder.DLL
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3623 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3631 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Security
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3613 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Security/2.0.0.0__b03f5f7f11d50a3a/System.Security.dll
----------------------------------------
System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
QECGBO
    Assembly Version: 2.6.0.6
    Win32 Version: 02.06.000.006
    CodeBase: file:///D:/ECGDEV/Development%202.4/QECGWindows/QECGGUI/bin/Debug/QECGBO.DLL
----------------------------------------
Quintiles.ECG.CalECGControl
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/ECGDEV/Development%202.4/QECGWindows/QECGGUI/bin/Debug/Quintiles.ECG.CalECGControl.DLL
----------------------------------------
QECGCommon
    Assembly Version: 2.6.0.5
    Win32 Version: 02.06.000.006
    CodeBase: file:///D:/ECGDEV/Development%202.4/QECGWindows/QECGGUI/bin/Debug/QECGCommon.DLL
----------------------------------------
QECG.Common.Infrastructure
    Assembly Version: 2.6.0.6
    Win32 Version: 02.06.000.006
    CodeBase: file:///D:/ECGDEV/Development%202.4/QECGWindows/QECGGUI/bin/Debug/QECG.Common.Infrastructure.DLL
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
Telerik.WinControls.UI
    Assembly Version: 2011.3.11.1116
    Win32 Version: 2011.3.11.1116
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls.UI/2011.3.11.1116__5bb2a467cbec794e/Telerik.WinControls.UI.dll
----------------------------------------
Telerik.WinControls
    Assembly Version: 2011.3.11.1116
    Win32 Version: 2011.3.11.1116
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls/2011.3.11.1116__5bb2a467cbec794e/Telerik.WinControls.dll
----------------------------------------
QECG.Common.Infrastructure.DataAccess
    Assembly Version: 2.6.0.6
    Win32 Version: 02.06.000.006
    CodeBase: file:///D:/ECGDEV/Development%202.4/QECGWindows/QECGGUI/bin/Debug/QECG.Common.Infrastructure.DataAccess.DLL
----------------------------------------
Oracle.DataAccess
    Assembly Version: 2.112.2.0
    Win32 Version: 2.112.2.0
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/Oracle.DataAccess/2.112.2.0__89b483f429c47342/Oracle.DataAccess.dll
----------------------------------------
System.Transactions
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
Telerik.WinControls.GridView
    Assembly Version: 2011.3.11.1116
    Win32 Version: 2011.3.11.1116
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Telerik.WinControls.GridView/2011.3.11.1116__5bb2a467cbec794e/Telerik.WinControls.GridView.dll
----------------------------------------
Quintiles.Windows
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/ECGDEV/Development%202.4/QECGWindows/QECGGUI/bin/Debug/Quintiles.Windows.DLL
----------------------------------------
System.Core
    Assembly Version: 3.5.0.0
    Win32 Version: 3.5.30729.1 built by: SP
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
TelerikCommon
    Assembly Version: 2011.3.11.1116
    Win32 Version: 2011.3.11.1116
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/TelerikCommon/2011.3.11.1116__5bb2a467cbec794e/TelerikCommon.dll
----------------------------------------
rn3-buiv
    Assembly Version: 2011.3.11.1116
    Win32 Version: 2.0.50727.3631 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


2 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 24 Apr 2012, 01:08 PM
Hi Rajesh,

I was just about to write that attachments in forums are not possible (except images), when I noticed that you had submitted a support ticket where your file is correctly attached. We will reply there soon.

Greetings,
Nikolay
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
Nikolay
Telerik team
answered on 24 Apr 2012, 03:10 PM
Hello Rejesh,

You can now find the answer to your question in your ticket. I am pasting the answer here in case our community is interested in the case:

I tried to reproduce the described issue in a sample project, but to no avail. However, I noticed something that potentially can lead to an issue.

In order to optimize the performance of RadGridView and its editors, we are reusing the editors instances.
In your CellBeginEdit event, you are subscribing the editor element instance to SelectedIndexChange, but please not that you are never unsubscribing from it. Editing a drop-down cell several times would result in the SelectedIndexChanged event being fired the same number of times per just one change of the selected item from the drop-down. Therefore, I would suggest that you first unsubscribe from the event and then subscribe to it:

RemoveHandler editorElement.SelectedIndexChanged, AddressOf editorElement_SelectedIndexChanged
AddHandler editorElement.SelectedIndexChanged, AddressOf editorElement_SelectedIndexChanged

A bit off topic, I would also recommend using our code snippet tool from the ticket editor that will allow you to format the code that you send.

I hope this helps.

Kind regards,
Nikolay
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Rajesh
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or