文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>SharpDataGridView OnDataError

SharpDataGridView OnDataError

时间:2010-08-30  来源:leslie116

  protected override void OnDataError(bool displayErrorDialogIfNoHandler, DataGridViewDataErrorEventArgs e)
        {
            if ((e.Exception) is ConstraintException)
            {
                //DataGridView view = (DataGridView)sender;
                this.Rows[e.RowIndex].ErrorText = e.Exception.Message;
                e.Cancel = true;
                e.ThrowException = false;
                //displayErrorDialogIfNoHandler = false;
            }
            base.OnDataError(displayErrorDialogIfNoHandler, e);
            //MessageBox.Show("Error happened " + e.Context.ToString());

            //if (e.Context == DataGridViewDataErrorContexts.Commit)
            //{
            //    MessageBox.Show("Commit error");
            //}
            //if (e.Context == DataGridViewDataErrorContexts.CurrentCellChange)
            //{
            //    MessageBox.Show("Cell change");
            //}
            //if (e.Context == DataGridViewDataErrorContexts.Parsing)
            //{
            //    MessageBox.Show("parsing error");
            //}
            //if (e.Context == DataGridViewDataErrorContexts.LeaveControl)
            //{
            //    MessageBox.Show("leave control error");
            //}

            //if ((e.Exception) is ConstraintException)
            //{
            //    //DataGridView view = (DataGridView)sender;
            //    this.Rows[e.RowIndex].ErrorText = "an error";
            //    this.Rows[e.RowIndex].Cells[e.ColumnIndex].ErrorText = "an error";

            //    e.ThrowException = false;
            //}

        }

相关阅读 更多 +
排行榜 更多 +
育龙高手魔晶无限版

育龙高手魔晶无限版

模拟经营 下载
寻找乔双人行手游下载

寻找乔双人行手游下载

冒险解谜 下载
神圣正义银河流放者游戏下载

神圣正义银河流放者游戏下载

飞行射击 下载