﻿<?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 results sorting issue</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 12 Apr 2026 09:32:56 GMT</lastBuildDate><ttl>20</ttl><item><title>BrowseDialog results sorting issue</title><link>http://forum.strataframe.net/FindPost31480.aspx</link><description>&lt;p class="MsoNormal"&gt;Hello,&lt;/p&gt;&lt;p class="MsoNormal"&gt;I am having an issue with the sorting in the browse dialog search result grid. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Most of the time sorting in the browse dialog results is notan issue, but one of our customers put some data in there that seems to havecaused a problem. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;As you can see from the screenshot I’ve attached, the“08-4882” and “01-9993” Product numbers are out of order. This is afterclicking the header to make sure that it is sorting. I have even tried using the Default Column Sort option in the Browse Results Column Properties.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;This is a big problem for them since they need to search for substrings of the product number. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;I have also attached a simple project where I have reproduced this problem. I have it pointed at the AdventureWorks database Production.Product table. But I changed the ProductNumber field to match those that I am finding cause a problem. You should be able to reproduce this issue by changing ProductNumber value for a group of products that you can load up easily in the BD. Here is the list for help:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;p class="MsoNormal"&gt;GOVTEST&amp;nbsp;AB123&amp;nbsp;GOVTEST1&amp;nbsp;11-2883&amp;nbsp;08-4882&amp;nbsp;01-9993&amp;nbsp;11-0021&amp;nbsp;12-1887&amp;nbsp;10-3774&lt;/p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Is there a fix for this?&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Thank You!,&lt;/p&gt;&lt;p class="MsoNormal"&gt;Govinda&lt;/p&gt;</description><pubDate>Fri, 05 Oct 2012 09:12:03 GMT</pubDate><dc:creator>Govinda Berrio</dc:creator></item><item><title>RE: BrowseDialog results sorting issue</title><link>http://forum.strataframe.net/FindPost31488.aspx</link><description>By the way... sorry I forgot. You are welcome! &lt;span&gt;;)&lt;/span&gt;</description><pubDate>Fri, 05 Oct 2012 09:12:03 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: BrowseDialog results sorting issue</title><link>http://forum.strataframe.net/FindPost31487.aspx</link><description>Yep, strange.&lt;br/&gt;&lt;br/&gt;But I have a feeling the sorter is thinking that that would be a date or something like that, showing Month-Year.&lt;br/&gt;Well, I don't know... but as soon as I get some time over here I will investigate the source code to see if I find it. That is, after I get some sleep and after I get the chance to see if the sun is still outside... &lt;span&gt;:D&lt;/span&gt;</description><pubDate>Fri, 05 Oct 2012 09:11:30 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: BrowseDialog results sorting issue</title><link>http://forum.strataframe.net/FindPost31486.aspx</link><description>Thanks Ivan,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;That will do as a workaround.&amp;nbsp;&lt;div&gt;Hopefully the SF guys will see this thread and fix this.&amp;nbsp;&lt;div&gt;It is strange that others have not noticed this and posted something. This can't be the first time some has needed to sort numbers with hyphens in the BD search results.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Govinda</description><pubDate>Fri, 05 Oct 2012 08:57:14 GMT</pubDate><dc:creator>Govinda Berrio</dc:creator></item><item><title>RE: BrowseDialog results sorting issue</title><link>http://forum.strataframe.net/FindPost31483.aspx</link><description>Hi Govinda.&lt;br/&gt;&lt;br/&gt;I created a sample with the StrataframeSample database and was able to reproduce your issue. &lt;br/&gt;Did you notice that for the codes that start with numbers, the sorter is only taking into cosideration the second part of your product code, the number after the dash (-) ?&lt;br/&gt;&lt;br/&gt;So, noticing that, I came up with a quick and dirty solution that could get you going tomorrow morning.&lt;br/&gt;&lt;br/&gt;On the BrowseDialogLayout, set your Column Population Type to PopulatedThroughEvent. Then, use the BD RowPopulating event to define your code as follows:&lt;br/&gt;&lt;br/&gt;&lt;span&gt;[codesnippet]&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub BrowseDialog1_RowPopulating(e As MicroFour.StrataFrame.UI.Windows.Forms.RowPopulatingEventArgs) Handles BrowseDialog1.RowPopulating&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; With CType(e.BusinessObject, Products)&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; '-- set Product Code&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 = "(" &amp;amp; .prod_SKU &amp;amp; ")"&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;/span&gt;&lt;br/&gt;&lt;br/&gt;That is it, put "(" and ")" around them all. This way, the sorte won't get confused and will sort them all as strings.&lt;br/&gt;&lt;br/&gt;Hope it helps.</description><pubDate>Thu, 04 Oct 2012 20:41:55 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: BrowseDialog results sorting issue</title><link>http://forum.strataframe.net/FindPost31482.aspx</link><description>Hi Edhy,&lt;div&gt;I am expecting it to sort as a character string. When I run that query sorting by ProductNumber, which is NVARCHAR, I get the correct rusults (see screenshot). When I paste the list into Excel and sort, I get the correct results. For some reason, not in the browse dialog.&lt;div&gt;Unfortunately, I can't cast to integer because the ProductNumber values will have hypens. Most will look like this: "08-4882".&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Thanks,&lt;div&gt;Govinda</description><pubDate>Thu, 04 Oct 2012 18:51:41 GMT</pubDate><dc:creator>Govinda Berrio</dc:creator></item><item><title>RE: BrowseDialog results sorting issue</title><link>http://forum.strataframe.net/FindPost31481.aspx</link><description>Hi Govinda,&lt;br/&gt;&lt;br/&gt;Have you try going to SQL Management Studio and do a &lt;strong&gt;&lt;span style="font-style: italic;"&gt;"SELECT * FROM TableName ORDER BY ProductNo"&lt;/span&gt;&lt;/strong&gt; and see if the order shows up the way you are expecting?&lt;br/&gt;&lt;br/&gt;When you have character values which values may start with zeros "0", sorting may not always be the way you are expecting, some developers even create a calculated field in SQL with the value of of the ProductNo as integer for sorting purpose ex:&lt;br/&gt;&amp;nbsp;&lt;strong&gt;&lt;span style="font-style: italic;"&gt;"SELECT *, CAST(ProductNo AS INTEGER) AS ProductNoToBeSorted FROM TableName ORDER BY &lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-style: italic;"&gt;&lt;strong&gt;&lt;span style="font-style: italic;"&gt;CAST(ProductNo AS INTEGER)&lt;/span&gt;&lt;/strong&gt;"&lt;/span&gt;&lt;/strong&gt;</description><pubDate>Thu, 04 Oct 2012 17:29:55 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>