|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Add value to data-bound datagridview during run-timeI've a datagridview control bound to dataset/datatable via bindingsource.The datatable has 4 columns, 1st column hidden in datagridview, and value was added by program during run-time, the rest 3 columns enter by user. I've set datagridview allow add/edit/delete. I know you can't programmly add value to datagridview which bound to a data source. The value has to be add to data table instead. The problem is: when I finish enter values for 3 visible columns and leave cursor, now i got error: 1st column value null not allowed. I've try put code in binding source event like: addingnew, currentchanged and currentitemchanged etc. but does not work. I think my code may have problem (sorry can't paste code here, i leave it in office pc). How can i reference to current editing row and which event will fire before new row added to data table? i use vsts 2008 Many thanks for your help! A.Y. Xu Hi,
Can you see what the binding events can do for you http://www.vb-tips.com/DataBindingEvents.aspx Cor Show quoteHide quote "AY Xu" <ay***@yahoo.com> wrote in message news:a2a73093-d871-4ada-8eb5-c8d03730a8c2@f10g2000vbf.googlegroups.com... > Dear expert, > > I've a datagridview control bound to dataset/datatable via > bindingsource.The datatable has 4 columns, 1st column hidden in > datagridview, and value was added by program during run-time, the rest > 3 columns enter by user. I've set datagridview allow add/edit/delete. > I know you can't programmly add value to datagridview which bound to a > data source. The value has to be add to data table instead. > > The problem is: when I finish enter values for 3 visible columns and > leave cursor, now i got error: 1st column value null not allowed. > I've try put code in binding source event like: addingnew, > currentchanged and currentitemchanged etc. but does not work. > I think my code may have problem (sorry can't paste code here, i leave > it in office pc). > How can i reference to current editing row and which event will fire > before new row added to data table? > > i use vsts 2008 > > Many thanks for your help! > A.Y. Xu
Problem with Windows Server 2003 Standard R2
Variable String Limit form top most when ran from sub main FILE I/O Inheritance? Interface? Is this Normal? Creating a list of a class OT: App respository Error adding a data provider to a datagridview control Autosize the last column in a ListView control using WndProc [2008] Collection of DipSwitches |
|||||||||||||||||||||||