﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » ComboBoxEdit: "Specified Cast is not valid"</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 29 May 2026 15:08:37 GMT</lastBuildDate><ttl>20</ttl><item><title>ComboBoxEdit: "Specified Cast is not valid"</title><link>http://forum.strataframe.net/FindPost10862.aspx</link><description>I have a ComboBoxEdit (StrataFrame Wrapped version of DevExpress ComboBoxEdit) that is being populated using the PopulationDataSourceSettings property and is bound to a BO and the PopulationType property is set to BusinessObject.&lt;br&gt;
&lt;br&gt;
The peculiar thing is that when i start typing in the ComboBoxEdit it begins autocompleting as I type. However if I misspell anyone of the entries in the combo an exception is thrown... Here is the stack:&lt;br&gt;
&lt;br&gt;
Specified cast is not valid.&lt;br&gt;
  &lt;br&gt;
  Exception (InvalidCastException): Message="Specified cast is not valid."; Source="STI"; Target=null; Tag=null; &lt;br&gt;
  &lt;br&gt;
  Environment:  ThreadIdentity="" DateTime=["2007-08-14 14:44:10.873"] ThreadName=null WindowsIdentity="STRUSS\MMurphy" ThreadId="10" DomainName="STI.vshost.exe" OSVersion=["Microsoft Windows NT 5.1.2600 Service Pack 2"] MachineName="1LPMMURPHY2" UserName="MMurphy"&lt;br&gt;
  &lt;br&gt;
    Remaining Stack Trace &lt;br&gt;
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=&lt;br&gt;
    at STI.ReturnsBO.FieldRTCustomerIDDescriptor.SetValue(Object component, Object Value) in C:\Documents and Settings\MMurphy\My Documents\Visual Studio 2005\Projects\STI2K5\Business Objects\ReturnsBO.Designer.vb:line 987&lt;br&gt;
    at System.Windows.Forms.BindToObject.SetValue(Object value)&lt;br&gt;
    at System.Windows.Forms.Binding.PullData(Boolean reformat, Boolean force)&lt;br&gt;
    at System.Windows.Forms.Binding.TargetPropertyChanged(Object sender, EventArgs e)&lt;br&gt;
    at DevExpress.XtraEditors.Repository.RepositoryItemComboBox.RaiseSelectedValueChanged(EventArgs e)&lt;br&gt;
    at DevExpress.XtraEditors.ComboBoxEdit.UpdatePopupEditValueIndex(Int32 prevIndex)&lt;br&gt;
    at DevExpress.XtraEditors.ComboBoxEdit.setEditValue(Object value)&lt;br&gt;
    at DevExpress.XtraEditors.TextEdit.setText(String value)&lt;br&gt;
    at DevExpress.XtraEditors.TextEdit.SetTextCore(String text)&lt;br&gt;
    at DevExpress.XtraEditors.PopupBaseAutoSearchEdit.FindUpdateEditValueAutoSearchText()&lt;br&gt;
    at DevExpress.XtraEditors.PopupBaseAutoSearchEdit.ProcessFindItem(Int32 selectionStart, Char pressedKey)&lt;br&gt;
    at DevExpress.XtraEditors.PopupBaseAutoSearchEdit.ProcessAutoSearchChar(KeyPressEventArgs e)&lt;br&gt;
    at DevExpress.XtraEditors.PopupBaseAutoSearchEdit.ProcessChar(KeyPressEventArgs e)&lt;br&gt;
    at DevExpress.XtraEditors.PopupBaseAutoSearchEdit.OnEditorKeyPress(KeyPressEventArgs e)&lt;br&gt;
    at DevExpress.XtraEditors.BaseEdit.OnKeyPress(KeyPressEventArgs e)&lt;br&gt;
    at DevExpress.XtraEditors.TextEdit.OnMaskBoxKeyPress(Object sender, KeyPressEventArgs e)&lt;br&gt;
    at System.Windows.Forms.Control.OnKeyPress(KeyPressEventArgs e)&lt;br&gt;
    at DevExpress.XtraEditors.Mask.MaskBox.OnKeyPress(KeyPressEventArgs e)&lt;br&gt;
    at System.Windows.Forms.Control.ProcessKeyEventArgs(Message&amp; m)&lt;br&gt;
    at DevExpress.XtraEditors.TextBoxMaskBox.ProcessKeyEventArgs(Message&amp; m)&lt;br&gt;
    at System.Windows.Forms.Control.ProcessKeyMessage(Message&amp; m)&lt;br&gt;
    at System.Windows.Forms.Control.WmKeyChar(Message&amp; m)&lt;br&gt;
    at System.Windows.Forms.Control.WndProc(Message&amp; m)&lt;br&gt;
    at System.Windows.Forms.TextBoxBase.WndProc(Message&amp; m)&lt;br&gt;
    at System.Windows.Forms.TextBox.WndProc(Message&amp; m)&lt;br&gt;
    at DevExpress.XtraEditors.Mask.MaskBox.BaseWndProc(Message&amp; m)&lt;br&gt;
    at DevExpress.XtraEditors.Mask.MaskBox.MaskStrategy.SimpleStrategy.DoWndProc(Message&amp; m)&lt;br&gt;
    at DevExpress.XtraEditors.Mask.MaskBox.WndProc(Message&amp; m)&lt;br&gt;
    at DevExpress.XtraEditors.TextBoxMaskBox.WndProc(Message&amp; msg)&lt;br&gt;
    at System.Windows.Forms.Control.ControlNative&amp;#119;indow.OnMessage(Message&amp; m)&lt;br&gt;
    at System.Windows.Forms.Control.ControlNative&amp;#119;indow.WndProc(Message&amp; m)&lt;br&gt;
    at System.Windows.Forms.Native&amp;#119;indow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Not sure what is going on. Any ideas?</description><pubDate>Tue, 28 Aug 2007 09:16:15 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: ComboBoxEdit: "Specified Cast is not valid"</title><link>http://forum.strataframe.net/FindPost11149.aspx</link><description>Good tip, jpp, thanks.</description><pubDate>Tue, 28 Aug 2007 09:16:15 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: ComboBoxEdit: "Specified Cast is not valid"</title><link>http://forum.strataframe.net/FindPost11112.aspx</link><description>When using the Strataframe DevExpress Wrapped ComboBoxEdit control, under it's Properties list, set the TextEditStyle property&amp;nbsp;to DisableTextEditor.&amp;nbsp;&amp;nbsp; The autofill will work fine without throughing an exception.</description><pubDate>Mon, 27 Aug 2007 11:53:59 GMT</pubDate><dc:creator>Jeff Pagley</dc:creator></item><item><title>RE: ComboBoxEdit: "Specified Cast is not valid"</title><link>http://forum.strataframe.net/FindPost10868.aspx</link><description>The error doesnt occur when the comboboxedit isnt bound.... I'll try it with a SF Combobox and let you know. &lt;/P&gt;&lt;P&gt;The reason we like the devexpress one instead of the SF one is because the devexpress one has an autocomplete feature, whereas the SF combo only navigates to the item that begins with the letter pressed. ;-) Just FYI.</description><pubDate>Tue, 14 Aug 2007 18:00:31 GMT</pubDate><dc:creator>StarkMike</dc:creator></item><item><title>RE: ComboBoxEdit: "Specified Cast is not valid"</title><link>http://forum.strataframe.net/FindPost10863.aspx</link><description>If you bind to an standard SF combo does this happen?&amp;nbsp; Also, if you create a DevEx combo that is not bound does the error occur?&amp;nbsp; The first thing I would do is see if the error occurs when you create an SF combo with the same population settings.</description><pubDate>Tue, 14 Aug 2007 15:20:30 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>