﻿<?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?)  » How do I maintain Alpha Order on a Maintenace Form</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 26 May 2026 22:30:49 GMT</lastBuildDate><ttl>20</ttl><item><title>How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost13779.aspx</link><description>I fill my business object by 'Select * from cowboys order by cow_lastname, cow_firstname' and then it comes in alphabetically. But when I add a new cowboy how do I keep the data in Alpha order? The form is a SF maintenance form but the navigation keys no longer work after I add a new cowboy. ???? TIA.</description><pubDate>Thu, 07 Feb 2008 11:32:55 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14172.aspx</link><description>Glad you got it going :)</description><pubDate>Thu, 07 Feb 2008 11:32:55 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14166.aspx</link><description>My Gad I got it to work the way I want with that little bit of code you gave me and where to put it. 40 posts to get to 3 lines of code. Your Help is Awsome. Thanks, I'm sure I will be back.....</description><pubDate>Thu, 07 Feb 2008 09:49:52 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14137.aspx</link><description>[quote]&lt;P&gt;It sounds like I could turn the sort off when adding and editing and as soon as they are over turn it back on. At that time I guess I would refresh the BO. I understand this concept but I do not understand how\where I would do these. I am sure I would turn it off beforesave and beforeedit if these events exists I will look and see and probably turn it on in aftersave.&lt;/P&gt;&lt;P&gt;[/quote]&lt;/P&gt;&lt;P&gt;Yes, but you will constantly be fighting this...my recommendation would be to use the ORDER BY within the query in this particular scenario.&amp;nbsp; Where you place this depends on what you are trying to accomplish, but BeforeAddNew would be one place to turn it off and AfterSave you could turn it back on.&lt;/P&gt;&lt;P&gt;[quote]I would&amp;nbsp;some way have to refresh the BO after saving the new record or saving the edit. Again where/how? [/quote]&lt;/P&gt;&lt;P&gt;In the AfterSave event you could resort the BO:&lt;/P&gt;&lt;P&gt;[codesnippet]MyBO.Sort = "cust_LastName"&lt;BR&gt;MyBo.CopyDataFrom(MyBo, ClearnAndFillFromDefaultView)&lt;BR&gt;MyBo.SOrt = ""[/codesnippet]</description><pubDate>Wed, 06 Feb 2008 16:45:02 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14122.aspx</link><description>OK the mud is starting to thin a bit. The BO is Dynamic and since the sort is on cust_lastname and cust_firstname it makes sense that as soon as those are added then the BO reshuffles and the form is filled with other data. According to what you have said it seems I have the following options.&lt;P&gt;If I use the Sort event:&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;It sounds like I could turn the sort off when adding and editing and as soon as they are over turn it back on. At that time I guess I would refresh the BO. I understand this concept but I do not understand how\where I would do these. I am sure I would turn it off beforesave and beforeedit if these events exists I will look and see and probably turn it on in aftersave.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If I don't use the Sort but use the Order by in the Select:&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;I would&amp;nbsp;some way have to refresh the BO after saving the new record or saving the edit. Again where/how? &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P dir=ltr&gt;I will start looking at events of the BO and see what a come up.&lt;/P&gt;&lt;P dir=ltr&gt;Again Thanks you so much.</description><pubDate>Wed, 06 Feb 2008 14:55:33 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14110.aspx</link><description>Sure, it is actually quite simple.&amp;nbsp; As you may have already learned, the BO has several exposed properties within the BO: CurrentDataTable, CurrentView, CUrrentRow, and CurrentRowIndex.&amp;nbsp; All of the BOs logic surrounds the CurrentView which is a DataView (CurentDataTable.DefaultView is the same reference).&amp;nbsp; The sort on a DataView is dynamic, so as soon as you add a new record (or modify a field within the sort), the view will "reshuffle" to match the updated values.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;TABLE style="FONT-SIZE: 9pt; FONT-FAMILY: Microsoft Sans Serif"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;DataView Index&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;cust_FirstName&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;cust_LastName&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Joe&lt;/TD&gt;&lt;TD&gt;Smith&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Trent&lt;/TD&gt;&lt;TD&gt;Taylor&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;P&gt;If I add a new record&amp;nbsp; and have a sort of (cust_LastName, cust_FirstName), the instant that the new row is added to the DataTable (which in turn is added to the view), the sort is effective and resorts the list:&lt;/P&gt;&lt;P&gt;&lt;TABLE style="FONT-SIZE: 9pt; FONT-FAMILY: Microsoft Sans Serif"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;DataView Index&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;cust_FirstName&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;cust_LastName&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;(empty)&lt;/TD&gt;&lt;TD&gt;(empty)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Joe&lt;/TD&gt;&lt;TD&gt;Smith&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Trent&lt;/TD&gt;&lt;TD&gt;Taylor&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;P&gt;However, the CurrentRowIndex of the BO is still set to 0 since the BO has not actually navigated....so if you were to call a BO.Refresh() all of the fields would reflect the newly added record...but instead, you are only seeing changes to the fields that are changing which made it look like it was updating two records at once.&lt;/P&gt;&lt;P&gt;The Sort is a great feature and we use it often, but when you use Sort and Filter, you need to take into account new and modified records otherwise you will have strange behavior...I have chansed my tail more than once for this reason.</description><pubDate>Wed, 06 Feb 2008 13:54:28 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14105.aspx</link><description>Can you maybe explain a bit more why the sort is making the record pointer move when I add a record? I think I tried putting the the order by clause in the Select but when I added a record then the records were no longer in alpha order by name. After a record is added or edited how do you repopulate the BO so that the maintenance form will show them in Alpha order? First thanks for all of your attention and help. I am glad you found out what was wrong but for some reason I don't have my mind around how it works yet. Again Thank You.</description><pubDate>Wed, 06 Feb 2008 13:08:19 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14092.aspx</link><description>Ahhhh...yeah, that will&amp;nbsp;get you every time :)&amp;nbsp; You have a sort on the CustomersEditBO set to "cust_lastname, cust_firstname" ....so, when you create a new record, modify the name fields, etc. the record pointer is moving on you.&amp;nbsp; First, in this instance, I would order the records when they are retrieved with an ORDER BY command.&amp;nbsp; If you want to use the sort this way, you have to take it into account so when you create a new record, or are modifying a record, you need to remove the sort and then add it back once the editing is complete...that should get you going though. :)</description><pubDate>Wed, 06 Feb 2008 11:15:46 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14059.aspx</link><description>Alright here it is. Please let me know if I did it correctly. TIA.</description><pubDate>Tue, 05 Feb 2008 21:00:08 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14046.aspx</link><description>Yeah, zip up the solution and all of the sub folders and as for the SQL database, just do a backup and include that in a zip as well then I can restore your backup to my test server.</description><pubDate>Tue, 05 Feb 2008 15:14:58 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14045.aspx</link><description>I certainly can but I am not sure how to do it. Do I zip the solution subdirectory? And what do I do about the SQL database? TIA.</description><pubDate>Tue, 05 Feb 2008 15:09:30 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14031.aspx</link><description>Terry,&lt;/P&gt;&lt;P&gt;You have something going on with the BO.&amp;nbsp; Can you send me your project?</description><pubDate>Tue, 05 Feb 2008 13:58:27 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14029.aspx</link><description>I created a new form and dropped a BO on it. Now as soon as I start typing in the Company field exactly the same thing happens as the picture show I get the form filled in???? I don't have a clue. Why does it not happen on the first and last names???? Could it be the SQL back end that is doing it? TIA.</description><pubDate>Tue, 05 Feb 2008 13:32:17 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14021.aspx</link><description>I think that there is something fishy going on with your form (as I think that you already knew :) ).&amp;nbsp; If you create a new form, drop on the BO and a few of these fields, do you have the same behavior?&amp;nbsp; You need to determine if the issue is within the form or the BO itself...this would be one way to find out.</description><pubDate>Tue, 05 Feb 2008 11:12:00 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14020.aspx</link><description>I put the following two lines in the navigating event of the BO with a break point on the second line. The break point never fired.&lt;/P&gt;&lt;P&gt;dimension xcnt&amp;nbsp; as integer&lt;/P&gt;&lt;P&gt;xcnt = 1&lt;/P&gt;&lt;P&gt;I will try the Set event and see what happens. TIA.....</description><pubDate>Tue, 05 Feb 2008 10:45:12 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost14008.aspx</link><description>I can practically guarantee that you have an event that is being handled causing either the row to be set back to the previous row or causing some type of validation issue.&amp;nbsp; If you place a breakpoint in the Set of the BO property, you may then be able to see at what point the values are being set or updated....also, the Navigated and Navigating events will definitely be firing...so if they are not firing then you may have your breakpoint in the wrong place.&amp;nbsp; Be sure to put your breakpoint in the Navigating of your BO (you may want to add some code in there so you can set your breakpoint).</description><pubDate>Tue, 05 Feb 2008 10:04:00 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost13985.aspx</link><description>I tried your suggestion about putting a break point in the navigating event of the BO. It is not fired because the break point does not fire. I have inserted a picture of what the form looks like and when I took this snap shot it was right after I entered the 1 in the address 1 text box. Any suggestions would be appreciated. TIA.&lt;br&gt;
&lt;br&gt;</description><pubDate>Mon, 04 Feb 2008 14:15:17 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost13970.aspx</link><description>Every Field after the First and Last name fields causes the other fields to fill with the info from the last person added. How can that possibly be? I have not tried your suggestion yet but I was just seeing if it was only one field that caused the form to autofill and found out it was not. This is more of frustration note more then anything else at this moment. I will try your suggestion and get back. TIA.</description><pubDate>Sun, 03 Feb 2008 10:45:50 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost13876.aspx</link><description>Looks like there is some sort of handler on the address field which is causing it to Navigate the record.&amp;nbsp; If all of the data is changing to a different record, then the business object is definitly navigating.&amp;nbsp; Put a handler on the business object's Navigating event and put a break point on that handler... when the handler fires, post the stack trace (along with all the extra stuff that shows when you turn off the "Just My Code" stuff mentioned above.</description><pubDate>Thu, 31 Jan 2008 13:16:56 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost13875.aspx</link><description>This gets more bizarre by the minute. I put the code in the setdefaultvalues event and that works but now when I create a new person I  get a negative number for the PK which I know I should (I just show the PK as read only), I can fill in the first name and last name and when I put the first character of the address field it automatically fills in the form with information (even the first and last name) from the last person I added and truncates parts of the name. Now I am really dorked up in terms of what to do and how could that happen??????? TIA......</description><pubDate>Thu, 31 Jan 2008 13:07:13 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost13873.aspx</link><description>OK, Thanks that is what I needed. I will try that and report back. I still believe this timedate field is what is screwing up the dirty record. I will keep at it...</description><pubDate>Thu, 31 Jan 2008 12:17:14 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost13869.aspx</link><description>Since the control is bound to the field on the business object, it is going to pull its value from the business object, so the best way to default it to the current date will be to set the field on the business object in the SetDefaultValues method to todays date.&amp;nbsp; DateTime.Now will work, or if you don't want the time, then DateTime.Now.Date.</description><pubDate>Thu, 31 Jan 2008 10:31:44 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost13867.aspx</link><description>I really don't want to control it so I will play with it some more and see if I can isolate that it is this control giving me the wierd results.&amp;nbsp; Is there a way to default the datetimepicker to the current date? TIA.</description><pubDate>Thu, 31 Jan 2008 10:16:10 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost13860.aspx</link><description>If you want to independently control the enabled state of that control, then you will want to set the IgnoreUIReadOnlyState to True on the control... this will cause the business object to leave it alone when it's enabling/disabling the controls when the object is edited/added/saved.&amp;nbsp; You would then need to control when that control is enabled.&amp;nbsp; I'm not sure what's causing it to think that the record is dirty, but if you disable the control when you're not wanting to edit the record, then it shouldn't copy any data back to the control.&lt;/P&gt;&lt;P&gt;If it's still causing you issues after you set the enabled state manually, then let me know.</description><pubDate>Thu, 31 Jan 2008 09:34:58 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: How do I maintain Alpha Order on a Maintenace Form</title><link>http://forum.strataframe.net/FindPost13843.aspx</link><description>OK I just started over with a new project and added a few fields at a time and I think I have it working but I have some questions about a datetimepicker. I wanted to use it as a time stamp as to when a record was created so on a maintenance form I would need it enabled on new but on edit I would not. Is that feesible?&lt;br&gt;
And that is what seems to be creating the grief even on the new project. If I enter it say on an edit and don't pick a date it seems to leave the record Dirty? Is that correct or is it something else? I have not checked the help yet but since I am here is there a way to default the datetimepicker to the current date?&lt;br&gt;
TIA again and again.</description><pubDate>Wed, 30 Jan 2008 10:48:49 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item></channel></rss>