PC Review


Reply
Thread Tools Rate Thread

DataGridViewComboBoxColumn error

 
 
=?Utf-8?B?ZGltZW5zaW9u?=
Guest
Posts: n/a
 
      1st Dec 2004
Hi, i have DataGridView whose sourse i set to a datatable with 5 columns
containing data. i then remove the 3rd column, created a
DataGridViewComboBoxColumn, set it's DataSource, ValueMember and
DisplayMember. the Valumeber is an integer and the displaymember is a
string. I then instert this into the same location as the column that was
removed. the problem i am getting is when the Grid is loaded, i get errors
stating "System.FormatException: the value of the DataGridViewComboBoxCell is
invalid. To replace this default dialog, please handle the DataError
event.".
Why is this error happening?

here is the code that does the replacing and adding of a combo box:

private void addExchangeLookUpCombs( DataGridView dt )
{
dt.Columns.Remove( "exchange_id" );
DataGridViewComboBoxColumn cb = new DataGridViewComboBoxColumn( );
cb.DataSource = DbConnection.instance.getDbTable("StockExchange");
cb.ValueMember = "exchange_id";
cb.DisplayMember = "symbol";

cb.FlatStyle = FlatStyle.Flat;
dt.Columns.Insert( 2, cb );

}
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DatagridviewComboboxcolumn Mirna fawaz Microsoft Dot NET Framework Forms 0 13th Nov 2008 07:21 AM
Data error DataGridView DataGridViewComboBoxColumn QSIDeveloper Microsoft Dot NET 10 10th Mar 2008 04:43 AM
DataGridViewComboBoxColumn Prashant Majhwar Microsoft Dot NET Framework Forms 0 10th May 2007 08:20 PM
DataGridViewComboBoxColumn bungle Microsoft C# .NET 0 18th Oct 2006 09:59 AM
DataGridViewComboBoxColumn bungle@wizardbuy.com Microsoft Dot NET Framework Forms 0 17th Oct 2006 11:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:50 AM.