﻿<?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?)  » I want to be able to show a field from a joined table on the BrowseDialog listview.</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 09 May 2026 16:08:04 GMT</lastBuildDate><ttl>20</ttl><item><title>I want to be able to show a field from a joined table on the BrowseDialog listview.</title><link>http://forum.strataframe.net/FindPost20236.aspx</link><description>Back ground: I have 2 tables CD and Artist. CD has an Artist_FK that joins the Artist table. I want to show the name of the artist from the Artist table, in the search result&amp;nbsp;of the browsedialog instead of the foreign key. I have setup a custom field and it shows in the drop down of the browsedialog browseresultslayout.&lt;/P&gt;&lt;P&gt;When I click the search on the browsedialog I get an error. Artist is not recognized. When I walk through the debug code I see the browsedialog creates it's own fill method to return the results instead of using my fill method that contains the join. Is there a way to specify what fill method to use or a way to include my joined field?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Bill</description><pubDate>Tue, 21 Oct 2008 11:01:40 GMT</pubDate><dc:creator>Bill Spack</dc:creator></item><item><title>RE: I want to be able to show a field from a joined table on the BrowseDialog listview.</title><link>http://forum.strataframe.net/FindPost20252.aspx</link><description>Hi Bill,&lt;/P&gt;&lt;P&gt;Glad it work for you, but keep in mind that this method will do a trip to the database to get the Artist Name value to be shown in the listview, this is acceptable in most cases if your search in the BD (Browser Dialog) will not return many records, but if that is the case, there are many alternate methods like Trent and Ivan said, in which you can use either use an Scalar method to just return the Artist Name field or to create a temporary BO in the BD with all the Artist Name and use the BO.SeektoPrimaryKey(Artist_FK) to get its name in the RowPopulation event.</description><pubDate>Tue, 21 Oct 2008 11:01:40 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: I want to be able to show a field from a joined table on the BrowseDialog listview.</title><link>http://forum.strataframe.net/FindPost20249.aspx</link><description>Great you got it goind! :cool:</description><pubDate>Tue, 21 Oct 2008 09:59:13 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: I want to be able to show a field from a joined table on the BrowseDialog listview.</title><link>http://forum.strataframe.net/FindPost20247.aspx</link><description>I really appreciate the quick reply from the group. &lt;/P&gt;&lt;P&gt;I ended up using Edhy's sample to resolve my issue. Works great :D:D&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Bill</description><pubDate>Tue, 21 Oct 2008 09:42:55 GMT</pubDate><dc:creator>Bill Spack</dc:creator></item><item><title>RE: I want to be able to show a field from a joined table on the BrowseDialog listview.</title><link>http://forum.strataframe.net/FindPost20243.aspx</link><description>Oops, it looks like it took me too long to write the post... :D</description><pubDate>Tue, 21 Oct 2008 09:22:45 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: I want to be able to show a field from a joined table on the BrowseDialog listview.</title><link>http://forum.strataframe.net/FindPost20242.aspx</link><description>Sorry about that. I'm refering to the results listview in the browse dialog.&lt;/P&gt;&lt;P&gt;PopulateThroughEvent method sounds like the right one for me. I want to see the artist name in the listview not an info panel. I will just need to make a call to the retrieve the artist name based on the artist_FK on the current row right? &lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Bill</description><pubDate>Tue, 21 Oct 2008 09:22:35 GMT</pubDate><dc:creator>Bill Spack</dc:creator></item><item><title>RE: I want to be able to show a field from a joined table on the BrowseDialog listview.</title><link>http://forum.strataframe.net/FindPost20241.aspx</link><description>Hi Bill.&lt;P&gt;While setting the BrowseResultsDialog, by the time you are adding your foreign key column to be dislplayed, have a look at the Population Type, choose PopulatedThroughEvent.&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/270ef694-40ab-4c19-834b-7914.png"&gt;&lt;/P&gt;&lt;P&gt;Then, go to your BrowseDialog Events and add an event handler for the RowPopulating.&lt;/P&gt;&lt;P&gt;In it, you can deal with sending the appropriate content for the BrowseDialog results column, something like this:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub MyBrowseDialog_RowPopulating(ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.RowPopulatingEventArgs) Handles MyBrowseDialog.RowPopulating&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- you can use whatever methods suit you better to get the values you need&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- you could create a method on your BO with a ExecuteScalar method to bring back only the information needed &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- establish locals &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim loBO As New MyBO&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loBO.FillByPrimaryKey(MyOtherBO.MyForeignKey)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- set the contents&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; With CType(e.BusinessObject, MyBO)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Values(0).DisplayValue = loBO.MyField&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End With&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;BR&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;Hope it helps.</description><pubDate>Tue, 21 Oct 2008 09:21:53 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: I want to be able to show a field from a joined table on the BrowseDialog listview.</title><link>http://forum.strataframe.net/FindPost20240.aspx</link><description>Hi Bill,&lt;/P&gt;&lt;P&gt;I understand that you want to show the name of the Artist in the Browse Dialog Result listview instead of the Artist_FK value.&amp;nbsp; This is what you need to do:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In the CD business object (BO) you would create a Custom Field Property (CFP&amp;nbsp; - look in the help file for a sample) named ArtistName or something like that.&amp;nbsp; This CFP will use the Artist_FK value to search the artist record and return the Artist Name for that property, it would loook like this:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;[codesnippet][code]&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;summary&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;''' This property will return the Artist Name&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;/summary&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;''' &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&amp;lt;Browsable(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;False&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;), _&lt;/P&gt;&lt;P&gt;BusinessFieldDisplayInEditor(), _&lt;/P&gt;&lt;P&gt;Description(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"ArtistName"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;), _&lt;/P&gt;&lt;P&gt;DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)&amp;gt; _&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;ReadOnly&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; [ArtistName]() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; System.String&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; loBusinessObject &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; ArtistBO&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;loBusinessObject.FillByPrimaryKey(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Artist_FK)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; loBusinessObject.Count = 1 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; loBusinessObject.ArtistName&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Empty&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;' Release the Business Object&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;loBusinessObject.Dispose()&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Get&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;[/code][/codesnippet]&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Then, all you need to do is used this property ArtistName instead of the Artist_FK in your Browser Dialog "BrowseResultLayout" fields.&lt;/LI&gt;&lt;/UL&gt;</description><pubDate>Tue, 21 Oct 2008 09:21:13 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: I want to be able to show a field from a joined table on the BrowseDialog listview.</title><link>http://forum.strataframe.net/FindPost20237.aspx</link><description>Well, there are a couple of things here.&amp;nbsp; First of all, you didn't really mention if you were referring to the search fields or the results.&amp;nbsp; Depending on this you would go two different directions.&lt;/P&gt;&lt;P&gt;If you are referring to the Sarch Fields, then you can handle the Searching event of the browse dialog to maniulate the raw WHERE clause of the query.&amp;nbsp; Now redirecting to a join will be more difficult since it is another table.&amp;nbsp; So you may want to create a view to query that has the join done on the server side which would then make this easier without the need to managing the Searching event.&lt;/P&gt;&lt;P&gt;If you are referring to the results, then you can define the column as PopulateThroughEvent and call a scalar method to populate the value or use a browse information panel.&amp;nbsp; &lt;/P&gt;&lt;P&gt;So there are a lot of different options here, so depending on what you are trying to accomplish this should give you some ideas.</description><pubDate>Tue, 21 Oct 2008 09:10:43 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>