Share This!

Friday, July 20, 2012

Context Formatting, PreferredSize

Row n Column n Context Formatting, PreferredSize... System.Windows.Forms.DataGridViewDataErrorEventArgs 

I was working in Visual Studio 2010 on a desktop app and it started throwing this error hundreds of times.  This app is using SQL Server database, with a DataGridView on a form.

A little investigation showed  that the columns referenced were always ComboBox columns.  In my case they were comboboxes where the list info is being populated at runtime, and not from the dataset. 

how to fix it:

Simply make sure that the tableadapter.fill() is not executed until the combobox lists are already populated.



...

Bryan Valencia is a contributing editor and founder of Visual Studio Journey.  He owns and operates Software Services, a web design and hosting company in Manteca, California.

No comments:

Post a Comment

Contact Us

Name

Email *

Message *