单击数据网格视图的键盘输入后出现未处理的异常+ [英] Unhandled exception +following a click through the keyboard input of a datagridview

查看:53
本文介绍了单击数据网格视图的键盘输入后出现未处理的异常+的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

Hello every body,

I have a gridview with a BindingSource datasource
I do a filter on the BindingSource then I add a row in the grid and then I click enter the following exception appears entree




$ b $bàSystem.Collections.ArrayList.get_Item(Int32 index)

àSystem.Windows.Forms.DataGridViewRowCollection.SharedRow(Int32 rowIndex)
$ b $bàSystem.Windows.Forms.DataGridView.get_CurrentCellInternal()
$ b $bàSystem.Windows.Forms。 DataGridView.CommitEdit(DataGridViewCell& dataGridViewCurrentCell,DataGridViewDataErrorContexts context,DataGridViewValidateCellInternal validateCell,Boolean fireCellLeave,Boolean fireCellEnter,Boolean fireRowLeave,Boolean fireRowEnter,Boolea n fireLeave)
$ b $bàSystem.Windows.Forms.DataGridView.ProcessEnterKey(Keys keyData)
$ b $bàSystem.Windows.Forms.DataGridView.ProcessDialogKey(Keys keyData)
$ b $bàSystem.Windows.Forms.Control.ProcessDialogKey(Keys keyData)
$ b $bàSystem.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData)
$ b $bà System.Windows.Forms.Control.PreProcessMessage(消息&安培; msg)
$ b $bàSystem.Windows.Forms.Control.PreProcessControlMessageInternal(控制目标,消息和消息)
$ b $bàSystem.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& ; msg)
$ b $bàSystem.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg)
$ b $bàSystem.Windows .Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID,Int32 reason,int32 pvLoopData)
$ b $bàSystem.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason,ApplicationContext context)
$ b $bàSystem.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,ApplicationContext context)
$ b $bàSystem.Windows.Forms.Application.Run (表单mainForm)



à System.Collections.ArrayList.get_Item(Int32 index)
à System.Windows.Forms.DataGridViewRowCollection.SharedRow(Int32 rowIndex)
à System.Windows.Forms.DataGridView.get_CurrentCellInternal()
à System.Windows.Forms.DataGridView.CommitEdit(DataGridViewCell& dataGridViewCurrentCell, DataGridViewDataErrorContexts context, DataGridViewValidateCellInternal validateCell, Boolean fireCellLeave, Boolean fireCellEnter, Boolean fireRowLeave, Boolean fireRowEnter, Boolean fireLeave)
à System.Windows.Forms.DataGridView.ProcessEnterKey(Keys keyData)
à System.Windows.Forms.DataGridView.ProcessDialogKey(Keys keyData)
à System.Windows.Forms.Control.ProcessDialogKey(Keys keyData)
à System.Windows.Forms.TextBoxBase.ProcessDialogKey(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(IntPtr 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)

推荐答案

根据您提供的异常堆栈,您正在访问一个数组项不存在。
Based on the exception stack you have provided, you are accessing an array item that does not exist.


这篇关于单击数据网格视图的键盘输入后出现未处理的异常+的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆