﻿<?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 » Business Objects and Data Access (How do I?)  » BO.Sort for date</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 23 Sep 2026 10:18:00 GMT</lastBuildDate><ttl>20</ttl><item><title>BO.Sort for date</title><link>http://forum.strataframe.net/FindPost6585.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I try to sort my data in my BO using the code below.&lt;/P&gt;&lt;P&gt;However, it doesn't work. Listview always show the records using PK order. I have listview.sorting = none as well.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[codesnippet]this.itemPricesBO.FillByParentPrimaryKey(this.itemsBO.ItemID);&lt;BR&gt;this.itemPricesBO.Sort = "FromDate ASC";&lt;BR&gt;this.lvItemPrices.Requery();[/codesnippet]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Wed, 07 Feb 2007 10:08:41 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: BO.Sort for date</title><link>http://forum.strataframe.net/FindPost6616.aspx</link><description>You saved my life!!!!&lt;/P&gt;&lt;P&gt;Thank you</description><pubDate>Wed, 07 Feb 2007 10:08:41 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: BO.Sort for date</title><link>http://forum.strataframe.net/FindPost6612.aspx</link><description>Most likely, when you modify the record, the .NET binding is copying the value back more than once.&amp;nbsp; The first time, the value is being copied into the record, then the position of the record changes, but the CurrentRowIndex of the business object does not change.&amp;nbsp; So, when the binding copies the value back into the record again, the correct record is no longer selected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you have a sort set on a business object, it is best to remove the sort while you are editing a record or create a new business object and populate it with only the record that is being edited.&amp;nbsp;</description><pubDate>Wed, 07 Feb 2007 09:54:53 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: BO.Sort for date</title><link>http://forum.strataframe.net/FindPost6609.aspx</link><description>Hi,&lt;P&gt;OK, the sorting works. Thank you.&lt;/P&gt;&lt;P&gt;However, I hit the strange behavour.&lt;/P&gt;&lt;P&gt;I have price list record as shown below. I select the highlighted record and call myBO.Edit().&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/cc242fd7-bde6-4307-958b-1d5c.JPG"&gt;&lt;/P&gt;&lt;P&gt;If I make changes to "from date" that would cause sorting position changed, the next record "from date" value also would be changed&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/2943d028-cc2c-47f7-9d6c-dbba.JPG"&gt;&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#1f5080&gt;//Code for screen above.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Collections.Generic;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.ComponentModel;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Data;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Drawing;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Text;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Windows.Forms;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; JK.Inventory.BusinessObject.Product;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;namespace&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; JK.Inventory.UI.Windows.Forms.Product&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;partial&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ItemPriceMaintenance&lt;/FONT&gt;&lt;FONT size=2&gt; : MicroFour.StrataFrame.UI.Windows.Forms.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;StandardForm&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;decimal&lt;/FONT&gt;&lt;FONT size=2&gt; _LastPrice;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; ItemPriceMaintenance()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;InitializeComponent();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; cmdOK_Click(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemPricesBO.Save() == MicroFour.StrataFrame.Data.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;SaveUndoResult&lt;/FONT&gt;&lt;FONT size=2&gt;.Success)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;DialogResult = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;DialogResult&lt;/FONT&gt;&lt;FONT size=2&gt;.OK;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; cmdCancel_Click(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemPricesBO.Undo(MicroFour.StrataFrame.Business.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;BusinessUndoType&lt;/FONT&gt;&lt;FONT size=2&gt;.AllRows);&lt;/P&gt;&lt;P&gt;DialogResult = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;DialogResult&lt;/FONT&gt;&lt;FONT size=2&gt;.Cancel;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; tsbAdd_Click(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT size=2&gt; llSuccess;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemPricesBO.Add();&lt;/P&gt;&lt;P&gt;llSuccess = (&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.ItemPricechildFormDialog.ShowDialog() == &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;DialogResult&lt;/FONT&gt;&lt;FONT size=2&gt;.OK);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (!llSuccess)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemPricesBO.Undo(MicroFour.StrataFrame.Business.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;BusinessUndoType&lt;/FONT&gt;&lt;FONT size=2&gt;.CurrentRowOnly);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;else&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.lvItemPrices.Requery();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; tsbEdit_Click(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT size=2&gt; llSuccess;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemPricesBO.NavigateToPrimaryKey(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.lvItemPrices.SelectedItems[0].Tag);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemPricesBO.Edit();&lt;/P&gt;&lt;P&gt;llSuccess = (&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.ItemPricechildFormDialog.ShowDialog() == &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;DialogResult&lt;/FONT&gt;&lt;FONT size=2&gt;.OK);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (!llSuccess)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemPricesBO.Undo(MicroFour.StrataFrame.Business.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;BusinessUndoType&lt;/FONT&gt;&lt;FONT size=2&gt;.CurrentRowOnly);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;else&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;_LastPrice = 0;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.lvItemPrices.Requery();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; tsbRemove_Click(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemPricesBO.SeekToPrimaryKey(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.lvItemPrices.SelectedItems[0].Tag);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemPricesBO.DeleteCurrentRow(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.lvItemPrices.Requery();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; ItemPriceMaintenance_Load(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemPricesBO.FillByParentPrimaryKey(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemsBO.ItemID);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemPricesBO.Sort = &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"FromDate"&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.lvItemPrices.Requery();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; lvItemPrices_ListPopulating(MicroFour.StrataFrame.UI.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ListPopulatingEventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;e.Parameters[0].Value = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemPricesBO.CurrentView.ToTable(); &lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;//this.itemPricesBO;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;e.Parameters[1].Value = MicroFour.StrataFrame.Business.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;BusinessCloneDataType&lt;/FONT&gt;&lt;FONT size=2&gt;.ClearAndFillFromCompleteTable;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; lvItemPrices_RowPopulating(MicroFour.StrataFrame.UI.Windows.Forms.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;RowPopulatingEventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ItemPricesBO&lt;/FONT&gt;&lt;FONT size=2&gt; loItemPriceBO = ((&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ItemPricesBO&lt;/FONT&gt;&lt;FONT size=2&gt;)e.BusinessObject);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (loItemPriceBO.Price &amp;gt; _LastPrice)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;e.ImageIndex = 0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;else&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (loItemPriceBO.Price &amp;lt; _LastPrice)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;e.ImageIndex = 1;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;_LastPrice = loItemPriceBO.Price;&lt;/P&gt;&lt;P&gt;e.Values[0].DisplayValue = loItemPriceBO.FromDate.ToShortDateString();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;//e.Values[1].DisplayValue = loItemPriceBO.ToDate.ToShortDateString();&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;e.Values[1].DisplayValue = loItemPriceBO.Price.ToString(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"###,###,##0.00"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;&lt;P&gt;e.Values[2].DisplayValue = loItemPriceBO.MinPrice.ToString(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"###,###,##0.00"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;&lt;P&gt;e.Values[3].DisplayValue = loItemPriceBO.MaxPrice.ToString(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"###,###,##0.00"&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;/*e.Values[0].DisplayValue = loItemPriceBO.FromDate.ToShortDateString();&lt;/P&gt;&lt;P&gt;e.Values[1].DisplayValue = loItemPriceBO.Price.ToString("###,###,##0.00");&lt;/P&gt;&lt;P&gt;e.Values[2].DisplayValue = loItemPriceBO.MinPrice.ToString("###,###,##0.00");&lt;/P&gt;&lt;P&gt;e.Values[3].DisplayValue = loItemPriceBO.MaxPrice.ToString("###,###,##0.00");&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; itemPricesBO_ParentFormLoading()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;P&gt;//Code in my editor form.&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Collections.Generic;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.ComponentModel;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Data;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Drawing;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Text;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Windows.Forms;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;namespace&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; JK.Inventory.UI.Windows.Forms.Product&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;partial&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;ItemPriceEditor&lt;/FONT&gt;&lt;FONT size=2&gt; : JK.Inventory.UI.Windows.Forms.Product.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;PriceEditorBase&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;FONT size=2&gt; ItemPriceEditor()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;InitializeComponent();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; cmdOK_Click(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.itemPricesBO.CheckRulesOnRow())&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;DialogResult = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;DialogResult&lt;/FONT&gt;&lt;FONT size=2&gt;.OK;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt; cmdCancel_Click(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; sender, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;EventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;DialogResult = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;DialogResult&lt;/FONT&gt;&lt;FONT size=2&gt;.Cancel;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;[/codesnippet]&lt;P&gt;I did anything wrong? Sorry, I am new to .NET.&lt;P&gt;Thank you</description><pubDate>Wed, 07 Feb 2007 09:18:31 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: BO.Sort for date</title><link>http://forum.strataframe.net/FindPost6606.aspx</link><description>Yes,&amp;nbsp;you have to use the CopyDataFrom(DataTable,..) rather than the CopyDataFrom(BusinessLayerBase,...) because of how you are trying to do your sort.&amp;nbsp; Then when you provide the first parameter in the ListPopulating event you will provide the CurrentView like this:&lt;/P&gt;&lt;P&gt;[codesnippet]e.Parameters(0).Value = MyBO.CurrentView.ToTable()[/codesnippet]&lt;/P&gt;&lt;P&gt;This will populate using your sort.</description><pubDate>Wed, 07 Feb 2007 07:55:27 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: BO.Sort for date</title><link>http://forum.strataframe.net/FindPost6605.aspx</link><description>Hi,&lt;BR&gt;Yes, I have set &lt;P&gt;lvPrices.PopulateDataSourceSettings to CopyDataFrom(BusinessLayerBase, BusinessCloneDataType)&lt;/P&gt;&lt;P&gt;lvPrice.PopulateOnFormLoad = 'Manual'&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;I also have these code&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;[codesnippet]private void ItemPriceMaintenance_Load(object sender, EventArgs e)&lt;BR&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;this.itemPricesBO.FillByParentPrimaryKey(this.itemsBO.ItemID);&lt;BR&gt;this.itemPricesBO.Sort = "fromdate";&lt;BR&gt;this.lvItemPrices.Requery();&lt;BR&gt;}[/codesnippet]&lt;/P&gt;&lt;P&gt;I also faced very strange things here. If I set something to sort property, my changes to one record would affect the next record also.&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[codesnippet]private void tsbEdit_Click(object sender, EventArgs e)&lt;BR&gt;{&lt;BR&gt;bool llSuccess;&lt;BR&gt;this.itemPricesBO.NavigateToPrimaryKey(this.lvItemPrices.SelectedItems[0].Tag);&lt;BR&gt;this.itemPricesBO.Edit();&lt;BR&gt;llSuccess = (this.ItemPricechildFormDialog.ShowDialog() == DialogResult.OK);&lt;BR&gt;if (!llSuccess)&lt;BR&gt;{&lt;BR&gt;this.itemPricesBO.Undo(MicroFour.StrataFrame.Business.BusinessUndoType.CurrentRowOnly);&lt;BR&gt;}&lt;BR&gt;else&lt;BR&gt;{&lt;BR&gt;_LastPrice = 0;&lt;BR&gt;this.lvItemPrices.Requery();&lt;BR&gt;}[/codesnippet]&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;P&gt;Childform OK button&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;[codesnippet]private void cmdOK_Click(object sender, EventArgs e)&lt;BR&gt;{&lt;BR&gt;if (this.itemPricesBO.CheckRulesOnRow())&lt;BR&gt;{&lt;BR&gt;DialogResult = DialogResult.OK;&lt;BR&gt;}&lt;BR&gt;}[/codesnippet]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I try to set expression to currentview.sort directory and view the data, it doesnt sort also.&lt;/P&gt;&lt;P&gt;[codesnippet]this.itemPricesBO.CurrentView.Sort&lt;BR&gt;this.itemPricesBO.CurrentView.Table.Rows[0].ItemArray[2][/codesnippet]&lt;P&gt;Any ideas?</description><pubDate>Wed, 07 Feb 2007 07:28:09 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: BO.Sort for date</title><link>http://forum.strataframe.net/FindPost6596.aspx</link><description>You are sorting the BO outside of the confines of the ListView.&amp;nbsp; You are going to have to set the Sort of the BO, &lt;STRONG&gt;&lt;U&gt;THEN&lt;/U&gt;&lt;/STRONG&gt; populate the ListView.&amp;nbsp; Also, if you are using the PopulationDataSource settings of the ListView, you &lt;STRONG&gt;&lt;U&gt;MUST&lt;/U&gt;&lt;/STRONG&gt; use the CopyDataFrom method and populate from an already populated BO (which has a sort applied).&amp;nbsp; You can view the AdvancedList POpulation sample that was installed with StrataFrame to see how to use the CopyDataFrom method.</description><pubDate>Tue, 06 Feb 2007 17:41:37 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: BO.Sort for date</title><link>http://forum.strataframe.net/FindPost6595.aspx</link><description>Hi,&lt;br&gt;
Thank you for reply.&lt;br&gt;
I have tried myBO.Sort = "FromDate", but it doesn't work.&lt;br&gt;
Also, I need myBO to be sorted is because I would like to show an icon on listview based on previous and current record value. Sorting in listview would not apply in this case.&lt;br&gt;
&lt;br&gt;
Any other ideas?&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Tue, 06 Feb 2007 17:32:34 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: BO.Sort for date</title><link>http://forum.strataframe.net/FindPost6588.aspx</link><description>You cannot sort a data table, only a data view.&amp;nbsp; If you want to apply a sort to the BO then set the Sort of the BO or the DefaultView of the data table.&lt;P&gt;[codesnippet]MyBO.Sort = "MySortField"&lt;BR&gt;or&lt;BR&gt;MyDataTable.DefaultView.Sort = "MySortField"[/codesnippet]&lt;/P&gt;&lt;P&gt;However, if you use the DefaultView, then you will have to populate from&amp;nbsp;the DefaultView as the DataTable does not respect the sort, only the view does.&lt;/P&gt;&lt;P&gt;As for sort a ListView, you can do this a number of ways.&amp;nbsp; You can use an ORDER BY on your SELECT statement, or you can use ListViewColumnSorter within the framework.&amp;nbsp; There is a class that will sort the ListView columns for you.&lt;/P&gt;&lt;P&gt;[codesnippet]Private _ListSorter As New MicroFour.StrataFrame.UI.Windows.Forms.ListViewColumnSorter(SortOrder.Ascending,0)&lt;BR&gt;Private Sub lvParent_AfterRequery() Handles lvParent.AfterRequery&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.lvParent.ListViewItemSorter = _ListSorter&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.lvParent.Sort()&lt;BR&gt;End Sub&lt;BR&gt;&lt;BR&gt;Private Sub lvParent_ColumnClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnClickEventArgs) Handles lvParent.ColumnClick&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _ListSorter.SetSort(SortOrder.Ascending, e.Column)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.lvParent.ListViewItemSorter = _ListSorter&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.lvParent.Sort()&lt;BR&gt;End Sub[/codesnippet]&lt;P&gt;FYI, by default the ListViewColumnSorter will automatically invert from Ascending to Descending if the same column is clicked over and over again.</description><pubDate>Tue, 06 Feb 2007 11:23:22 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: BO.Sort for date</title><link>http://forum.strataframe.net/FindPost6586.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I checked data in currentdatatable, it doesn't sort.</description><pubDate>Tue, 06 Feb 2007 11:02:55 GMT</pubDate><dc:creator>Chan</dc:creator></item></channel></rss>