We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Specified cast not valid

Thread ID:





32112 Jul 21,2005 06:24 PM UTC Jul 21,2005 07:24 PM UTC WinForms 3
Tags: GridControl
Adam K.
Asked On July 21, 2005 06:24 PM UTC

i am trying to set the value of a combobox cell with the following code: gridcontrol1[gridcontrol1.RowCount, CurCol].Text = ti.defaultvalue; where defaultvalue is a string. I am getting a runtime error (invalid cast exceptions: Specified cast not valid)l thanks, ak

Administrator [Syncfusion]
Replied On July 21, 2005 06:41 PM UTC

Are you using style.DataSource, Style.DisplayeMember, style.ValueMember to set up the combobox cell? If so, is your ValueMember a string? If not, then you should not be setting .Text. Instead set .CellValue = to the object (of the proper type).

Adam K.
Replied On July 21, 2005 06:48 PM UTC

i am setting it up as a combo box with following code _g[_g.RowCount, CurCol].ChoiceList = ti.enumeration; _g[_g.RowCount, CurCol].CellType = "ComboBox"; where ti.enumeration is a StringCollection please let me know your thoughts. thanks, ak

Administrator [Syncfusion]
Replied On July 21, 2005 07:24 PM UTC

Here is sample set up you described. http://www.syncfusion.com/Support/user/uploads/GC_Combobox_5b7f9a8f.zip It seems to work OK. Do you have other settings like style.DropDownStyle or style.Exclusive or style.CellValueType that might be affecting this.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon