使用DataGridView Popup,在datagridview.columns.clear()调用中获取异常. [英] Using the DataGridView Popup, get exception on datagridview.columns.clear() call.

查看:93
本文介绍了使用DataGridView Popup,在datagridview.columns.clear()调用中获取异常.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到dataGridView1.Columns.Clear(); DataDridView Popup代码都可以正常工作.叫做.这导致在以下方法中引发异常:

DgvFilterManager.cs mDataGridView_ColumnRemoved

异常表示:

填充GridView控件错误:索引超出范围.必须为非负数并且小于集合的大小.参数名称:index.

The DataDridView Popup code works well until dataGridView1.Columns.Clear(); is called. This results in an exception being thrown in the following method:

DgvFilterManager.cs mDataGridView_ColumnRemoved

The exception indicates:

Populate GridView Control Error:Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index.

推荐答案

我认为您应该先清除相关数据
i think you should clear the related data first


这篇关于使用DataGridView Popup,在datagridview.columns.clear()调用中获取异常.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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