StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Browse Dialog and Custom FieldsExpand / Collapse
Author
Message
Posted 09/27/2006 12:18:32 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 08/23/2007 2:01:12 AM
Posts: 77, Visits: 804
I have a few custom (read-only) fields in a BO that works great when binding to controls.

I am having problems trying to use these fields inside a BrowseDialog control. I can select the fields to be searched, but when I try to search on one of those fields, I get the following error:

KeyNotFoundException
 The given key was not present in the dictionary.

Source     : mscorlib

Stack Trace:
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogWindow.BuildWhereElement(Int32 ParameterIndex)
   at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogWindow.BuildSearchWhereClause()
   at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogWindow.Search()
   at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogWindow.ExecuteSearch()
   at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogSearchToolStrip.cmdSearch_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)

Do I need to add something to the BO to allow custom fields to be searched?

Thanks!

Post #3118
Posted 09/27/2006 12:34:57 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 12/09/2008 3:36:08 PM
Posts: 2,686, Visits: 1,891
Ah, you cannot use a custom property as a search field because the search fields are directly translated back to the query that is executed on SQL Server.  So, if the column does not exist on SQL Server, the browse dialog cannot use the field as a search field because a) it doesn't know how to build a parameter for the field, and b) SQL Server would say the column didn't exist.


www.bungie.net
Post #3123
Posted 09/27/2006 12:54:02 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 08/23/2007 2:01:12 AM
Posts: 77, Visits: 804
Thud...Forehead has been smacked...=)

It is possible to override the search logic in the browseDialog? It would be nice to define a method in the BO which can be used to return search results.

Kevin

Post #3125
Posted 09/27/2006 1:17:36 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 6:26:12 PM
Posts: 4,901, Visits: 4,887
As of right now you cannot overwrite the browse logic.  We have thought about adding an event to allow stored procedures and the overwrite of the query information.  But this is probably a ways out.   Sorry.
Post #3126
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 7:36pm

Powered by InstantForum.NET v4.1.4 © 2009
Execution: 0.125. 15 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.