﻿<?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?)  » BrowseDialog</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 06 Jun 2026 21:50:31 GMT</lastBuildDate><ttl>20</ttl><item><title>BrowseDialog</title><link>http://forum.strataframe.net/FindPost23458.aspx</link><description>Can you provide a outline on how to use a view in a search with the new BrowseDialog or a sample?</description><pubDate>Mon, 15 Jun 2009 07:05:41 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: BrowseDialog</title><link>http://forum.strataframe.net/FindPost23494.aspx</link><description>[quote]First if you go back and edit a field that doesn't exist in the original table structure, the Search Field Criteria dialog doesn't "remember" the field name, it just defaults to the first field in the Search Field drop down. It also doesn't "remember" the Search Style which also defaults to the first field in the Search Field drop down.[/quote]&lt;br&gt;
&lt;br&gt;
Yeah, I noticed this as well and it is already on the list. :)&lt;br&gt;
&lt;br&gt;
[quote]Second I was wondering if the DataType override is suppose to set the appropriate available Search Styles, currently it has no impact.[/quote]&lt;br&gt;
&lt;br&gt;
No, this is for return types and casting.  Most times this is never needed.  We actually ended addressing some of the underlying issues that this caused within the class itself.  But this just enforces the data type on the return values for testing purposes.</description><pubDate>Mon, 15 Jun 2009 07:05:41 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: BrowseDialog</title><link>http://forum.strataframe.net/FindPost23479.aspx</link><description>Thanks for the sample; got it working and it's a lot easier than what I was doing before:D However there are a couple of quirks that would be nice if they could be fixed. First if you go back and edit a field that doesn't exist in the original table structure, the Search Field Criteria dialog doesn't "remember" the field name, it just defaults to the first field in the Search Field drop down. It also doesn't "remember" the Search Style which also defaults to the first field in the Search Field drop down. Second I was wondering if the DataType override is suppose to set the appropriate available Search Styles, currently it has no impact. To get the appropriate Search Styles when adding a view field, you first have to select a field of the same data type that exists in the original table as the view&amp;nbsp;data type&amp;nbsp;you're adding.</description><pubDate>Fri, 12 Jun 2009 11:57:36 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: BrowseDialog</title><link>http://forum.strataframe.net/FindPost23465.aspx</link><description>Here is a good example of when and how it should be used.&amp;nbsp; One of the issues that you run into with a BrowseDialog is that is represents a single table in the database.&amp;nbsp; However, there are times that you need to pull back a foreign key value, etc. Also, you don't really want to do this manually for each row through the RowPopulating event, as this would be slow and require the number of queries as you have rows.&amp;nbsp; So in this example, I would want to create a view with all of my JOINs so a single query pulls back all of the information that I need.&lt;/P&gt;&lt;P&gt;Moreover, I want to be able to SEARCH on those foreign key values.&amp;nbsp; Using a view I can make this happen.&amp;nbsp; In our medical application all of our phone numbers are stored in a foreign key table, yet our users wanted to be able to search on the patient home phone.&amp;nbsp; Well, this was not possible until this feature was added.&amp;nbsp; I now have a view that brings back the patient record as well as the 3 different phone types, and I can then add these as search fields and search.&lt;/P&gt;&lt;P&gt;Using this example, here is the view.&amp;nbsp; You will see that is strips out the dashes, parens, etc. since it will not be captured.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;View Named PatientBrowse&lt;/STRONG&gt;&lt;BR&gt;[codesnippet]SELECT&lt;BR&gt;&amp;nbsp;PT.*,&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;-- Get the top home phone&lt;BR&gt;&amp;nbsp;REPLACE(REPLACE(REPLACE(REPLACE(COALESCE(&lt;BR&gt;&amp;nbsp;(&lt;BR&gt;&amp;nbsp;&amp;nbsp;SELECT TOP 1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;PN.ph_PhoneNumber&lt;BR&gt;&amp;nbsp;&amp;nbsp;FROM PhoneNumbers AS PN&lt;BR&gt;&amp;nbsp;&amp;nbsp;WHERE PN.ph_ParentType = 2 AND &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PN.ph_pk_Parent = PT.pt_pk AND &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PN.ph_PhoneType = 0&lt;BR&gt;&amp;nbsp;&amp;nbsp;ORDER BY PN.ph_Rank&lt;BR&gt;&amp;nbsp;), ''),'(',''),')',''),'-',''),' ','') AS pt_HomePhoneBrowse,&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;-- Get the top work phone&lt;BR&gt;&amp;nbsp;REPLACE(REPLACE(REPLACE(REPLACE(COALESCE(&lt;BR&gt;&amp;nbsp;(&lt;BR&gt;&amp;nbsp;&amp;nbsp;SELECT TOP 1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;PN.ph_PhoneNumber&lt;BR&gt;&amp;nbsp;&amp;nbsp;FROM PhoneNumbers AS PN&lt;BR&gt;&amp;nbsp;&amp;nbsp;WHERE PN.ph_ParentType = 2 AND &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PN.ph_pk_Parent = PT.pt_pk AND &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PN.ph_PhoneType = 1&lt;BR&gt;&amp;nbsp;&amp;nbsp;ORDER BY PN.ph_Rank&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;), ''),'(',''),')',''),'-',''),' ','') AS pt_WorkPhoneBrowse,&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;-- Get the top mobile phone&lt;BR&gt;&amp;nbsp;REPLACE(REPLACE(REPLACE(REPLACE(COALESCE(&lt;BR&gt;&amp;nbsp;(&lt;BR&gt;&amp;nbsp;&amp;nbsp;SELECT TOP 1&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;PN.ph_PhoneNumber&lt;BR&gt;&amp;nbsp;&amp;nbsp;FROM PhoneNumbers AS PN&lt;BR&gt;&amp;nbsp;&amp;nbsp;WHERE PN.ph_ParentType = 2 AND &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PN.ph_pk_Parent = PT.pt_pk AND &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PN.ph_PhoneType = 4&lt;BR&gt;&amp;nbsp;&amp;nbsp;ORDER BY PN.ph_Rank&lt;BR&gt;&amp;nbsp;), ''),'(',''),')',''),'-',''),' ','') AS pt_MobilePhoneBrowse&lt;BR&gt;&amp;nbsp;&lt;BR&gt;FROM Patients AS PT[/codesnippet]&lt;/P&gt;&lt;P&gt;This view is then tied to the BO as the overriding tablename:&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/bea9d9d7-9d88-4879-aa55-2476.png"&gt;&lt;/P&gt;&lt;P&gt;I will also add the search fields even though they do not exist as part of the original table structure:&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/9caed488-c145-4431-ace0-6380.png"&gt;&lt;/P&gt;&lt;P&gt;Now I can go and do a search and I will be able to search on these foreign key fields.&amp;nbsp; For display purposes in the results, you can just pull back another field in the view that leaves the formatting...or add the formatting back in on the display.&amp;nbsp; I recommend the 1st option as it requires far less work.&amp;nbsp; Hope this helps!</description><pubDate>Fri, 12 Jun 2009 09:01:01 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>