Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
Hi, I hit error below if I set a GUID field as browse search field. This search field is also set to use combobox - Business Object. Please advice. Thank you InvalidOperationException The input value could not be converted to the output type. FormatException Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). Source : MicroFour StrataFrame Base Stack Trace: at System.Guid..ctor(String g) at MicroFour.StrataFrame.Data.ObjectConverter.ConvertValue(Object InputValue, Type InputType, Type OutputType, String FormatString) at MicroFour.StrataFrame.Data.ObjectConverter.ConvertValue(Object InputValue, Type OutputType) at MicroFour.StrataFrame.UI.Windows.Forms.ListControl.PopulateComboFromBusinessObject(IListControl lstControl, Object[] Parameters) at MicroFour.StrataFrame.UI.Windows.Forms.ListControl.PopulateCombo(Control lstControl, Object[] Parameters) at MicroFour.StrataFrame.UI.Windows.Forms.ComboBox.PopulateCombo(Object[] Parameters) at MicroFour.StrataFrame.UI.Windows.Forms.ComboBox.Requery() at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogWindow.CreateBOCombo(SearchFieldItem Item) at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogWindow.CreateAllSearchFieldControls() at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogWindow.AddSearchFields() at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogWindow..ctor(BrowseDialog BrowseDialogSettings, Boolean PopulateOnShow) at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog(Boolean PopulateOnShow) at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog.ShowDialog() at MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.cmdBrowse_Click(Object sender, EventArgs e) at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
|
|
Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
No, I don't meant that. OK, I have a field called VendorID which is GUID field type. I add this field as browse dialog search field, ComboBox - business object (VendorsBO.FillAll()). I would hit error when I click on browse button. InvalidOperationException The input value could not be converted to the output type. FormatException Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
After some debugging, I found that, TopMostItem.TopMostValue is always defaulted as "-1" when combobox is created (as shown as below). When program try to convert TopMostValue to GUID, it hit error. Private Function CreateBOCombo(ByVal Item As SearchFieldItem) As Control ... .TopMostItem = New TopMostListItem(_BrowseDialog.EnumTopMostText, "-1")
Do you get what I meant? Please advice
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
Change the "-1" to "{00000000-0000-0000-0000-000000000000}" and give it a try. I have not tested this, but a -1 cannot be converted to a GUID.
|
|
|
Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
Hi, I cant test on it because my project no longer working after I compile SF source code. I got to reinstall SF.
|
|
|
Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
Hi, I am able to "hijack" the value of TopMostValue to change it from "-1" to "00000000-0000-0000-0000-000000000000" and it would work. I would wait for your next update. Thank you
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
We would have to test this on the GUID as this was not designed with this in mind. You can just create your own top most item instead of using the property.
|
|
|
Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
Hi, Which event should I place the code to create my own topmostitem? Do you meant to modify SF source code? Thank you
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
No, do not modify the SF source code. I was referring to adding an item to the data source that is shown within combo. Just another another item.
|
|
|
Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
Sorry, I am lost. Why to add another item to my datasource? My PL field is GUID. How to assign "-1" ? hmm... didn't get you.. sorry.
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
To add your own item, you would need to handle the DataSource changed event on the ComboBox. Within the event, you can add a new record to the top of the data table (.Insert() it rather than .Add() it). You can check the structure of the table for the field names, but it should only have two columns... a "display" column and a "value" column. Then, just set the values in the new record and insert it into the table.
|
|
|
Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
Hi, May I know if this issue been handled natively in upcoming update? Thank you
|
|
|
Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
Ben Chase (02/22/2007) To add your own item, you would need to handle the DataSource changed event on the ComboBox. Within the event, you can add a new record to the top of the data table (.Insert() it rather than .Add() it). You can check the structure of the table for the field names, but it should only havetwo columns... a "display" column and a "value" column. Then, just set the values in the new record and insert it into the table.Hi, Since the combobox in browsedialog is created at runtime while ShowDialog() method been called, how could I handle its DtaaSourceChanged event? Also, FYI, the error is occured at ListControl.PopulateComboFromBusinessObject(). loNewRow.Item(VALUE) = MicroFour.StrataFrame.Data.ObjectConverter.ConvertValue(.TopMostItem.TopMostValue, loBO.GetPropertyDescriptor(.PopulationDataSourceSettings.ValueMember).PropertyType)
|
|
|
Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
Hi,
I found that this issue has been fixed in version 1.6.1.
I specified {00000000-0000-0000-0000-000000000000} in Top Most Value under Combo-General.
After I select item from combobox and click search, I hit error error below. Any ideas?
InvalidCastException
Conversion from type 'Guid' to type 'String' is not valid.
Source : Microsoft.VisualBasic
Stack Trace:
at Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value)
at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.BuildWhereElement(SearchFieldItem SearchField)
at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.BuildSearchWhereClause()
at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.ExecuteSearch()
at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.tsiSearch_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
The processing of the where element for GUID was assuming that the type could be cast or converted to a Guid, so I changed it so that it would use the Guid constructor and pass over the value.ToString() (the Guid constructor will then parse the value back into a valid Guid). So, it should fix the problem you're having. However, if you need the fix before then, then you can change your source code: BrowseDialogwindow.vb line 2207: loFieldValue.Add( New Guid(_CurrentValue.ToString()))Instead of the: loFieldValue.Add( CType(_CurrentValue, Guid))
|
|
|
Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
Hi,
Thank you answer.
When would next SF release? I am using SF 1.6.1 (posted at forum) which doesn't have source code. Therefore, I am not able to change my source code.
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
I am not positive when the next release will be... we are currently getting our finishing out the rest of the posted bugs and getting the install ready for VS2008 and 64-bit.
|
|
|
Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
Hi
Sorry, I still don't know how to solve this problem.
Where should I put my code? How to set Browsedialog combobox.topmost to Guid.Empty instead if '-1'?
Thank you
|
|
|