Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > how to create a new DataGridViewCellValidatingEventArgs object
 

how to create a new DataGridViewCellValidatingEventArgs object

i has override the method of OnCellValidating(DataGridViewCellValidatingEventArgs e) in DataGridView
and i also want to override the method
protected override void OnRowValidating(DataGridViewCellCancelEventArgs e)
and in OnRowValidating method i want to invoke the method of OnCellValidating,do as this:
protected override void OnRowValidating(DataGridViewCellCancelEventArgs e){
...
DataGridViewCellValidatingEventArgs ex=new DataGridViewCellValidatingEventArgs (columnIndex,rowInde,formatedValue);
OnCellValidating(ex);
...
base.OnRowValidating(e);
}
but the code
DataGridViewCellValidatingEventArgs ex=new DataGridViewCellValidatingEventArgs (columnIndex,rowInde,formatedValue);

is can not run success.throw erros as this:
错误125类型“System.Windows.Forms.DataGridViewCellValidatingEventArgs”未定义构造函数 F:\container\NFramework\NFramework\NFramework\control\NFDataGridView.cs58947NFramework

i an using visual studio 2005 and .net2.0 to do that,
can anybody help me?

jlle  Saturday, August 08, 2009 9:32 AM
That looks like Chinese to me. I can guess what it says, the constructor is not accessible. It is marked "internal". That is invariably done for a good reason, along the lines of "you'll break something if you create your own". If you really, really want to, you can invoke the constructor by using Reflection. ConstructorInfo.Invoke().

Not a BCL q, moved to Windows Forms.

Hans Passant.
nobugz  Saturday, August 08, 2009 2:45 PM
That looks like Chinese to me. I can guess what it says, the constructor is not accessible. It is marked "internal". That is invariably done for a good reason, along the lines of "you'll break something if you create your own". If you really, really want to, you can invoke the constructor by using Reflection. ConstructorInfo.Invoke().

Not a BCL q, moved to Windows Forms.

Hans Passant.
nobugz  Saturday, August 08, 2009 2:45 PM
that's good ideal,i'll try as you sead,thanks
jlle  Sunday, August 09, 2009 2:31 AM

You can use google to search for other answers

Custom Search

More Threads

• HELP for my ICT coursework
• DatagridView Slow
• Drag&Dropped table on dataset designer ........ Grrrrrrrrr
• Get type of datarow in typed Dataset
• Datagridview vs net 2005 - displayindex of columns.
• TableAdapters and Dirty processing
• How to use Binding class to a MultiLine Textbox ?
• Checkbox column in DataGridView
• SelectedIndex in ComboBox is always -1
• Mouse coordinates in CellMouseClick event