﻿<?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?)  » Order records in a maintenance form</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 05 May 2026 06:46:33 GMT</lastBuildDate><ttl>20</ttl><item><title>Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18212.aspx</link><description>Hi&lt;/P&gt;&lt;P&gt;I have a curious situation. I have a table for families, the BO has this method:&lt;/P&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;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;Sub&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; FillAllRecords()&lt;/P&gt;&lt;P&gt;&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;.FillDataTable(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"SELECT * FROM Familias ORDER BY Apellidos"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&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;Sub&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;P&gt;I add three records, one begin with H, second with D and las one with A. Every time I load the maintenance form, goes to the second record in this case the one beginning with D, the order is correct, the first record is the one with A but I can not understand why goes to the second one.&lt;/P&gt;&lt;P&gt;Regards</description><pubDate>Wed, 18 Mar 2009 08:02:41 GMT</pubDate><dc:creator>Juan Carlos Pazos</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost22421.aspx</link><description>Alex, I guess I don't understand your problem.&amp;nbsp; Your problem could be happening for a lot of reasons, and I don't think I have enough information to give you an answer.&amp;nbsp; Are you using the fully automated population of the ListView including the management of the Add, Edit, Delete buttons?&amp;nbsp; Or are the buttons you are referring to a MaintenanceFormToolstrip?&amp;nbsp; What is changing...when you select a ListView item the toolstrip is updated or when you navigate the ListView selected index is changing?</description><pubDate>Wed, 18 Mar 2009 08:02:41 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost22404.aspx</link><description>[quote][b]Trent L. Taylor (07/30/2008)[/b][hr]You can actually find your answer to this throughout the forum....[/quote]&lt;br&gt;
&lt;br&gt;
I never was able to find lots of Easter Eggs buried in the sand either... I give up! Where can I find the answer? &lt;br&gt;
&lt;br&gt;
I understand the RowIndex is causing my toolstrip's navigate buttons to cause the highlighted row in my listview and the other bound controls to "jump" in a sequence that is not expected based on the current sort order of the BO's datatable (i.e., the listview's rows are not sequentially navigated), but have not found how to handle this... only quite a few "yeah.. it's posted out here elsewhere" replies :( &lt;br&gt;
&lt;br&gt;
It's probably right in front of me, but...&lt;br&gt;
&lt;br&gt;
TIA</description><pubDate>Tue, 17 Mar 2009 10:18:20 GMT</pubDate><dc:creator>Alex Luyando</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18808.aspx</link><description>Sure :)&amp;nbsp; Sorry for the trouble!</description><pubDate>Wed, 27 Aug 2008 12:51:48 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18795.aspx</link><description>Thank's&amp;nbsp;a bunch Trent</description><pubDate>Wed, 27 Aug 2008 09:50:38 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18788.aspx</link><description>Here is the fix: &lt;A href="http://forum.strataframe.net/FindPost18786.aspx"&gt;http://forum.strataframe.net/FindPost18786.aspx&lt;/A&gt;</description><pubDate>Wed, 27 Aug 2008 09:30:49 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18785.aspx</link><description>Fixed...creating a new build as we speak and will post it within the next 30 minutes or so.&amp;nbsp; This problem was actually introduced on April 28, 2008 (during the 1.6.6 beta) in response to fixing another issue.&amp;nbsp; If you look at the SF source code, the _CurrentRowIndex is not a private but a property that was changed from a private to a property when the Shared DataTable was introduced to the framework.&amp;nbsp; Per some other threads and forum posts, there were certain conditions where the _CurrentRowIndex would be set to an illegal value on a Save or Undo which would produce an error (when records actually existed within the BO).&amp;nbsp; This was actually a correct change, but the framework had original code which attempted to set the index back 1 and then call the Navigate(Next)...well, if the _CurrentRowIndex was set to an illegal value, the index would not move...thus when the next was called, the record would move forward since the _CurrentRowIndex didn't actually change.&amp;nbsp; This has been&amp;nbsp;changed by logically raising the Navigated event and refreshing the bound controls versus forcing a navigate in all areas that had this logic...in short, it was an easy and quick fix and I will let you know when we have the new update posted (should be just a few minutes).</description><pubDate>Wed, 27 Aug 2008 09:17:08 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18783.aspx</link><description>Well as&amp;nbsp;I thought that was to good to be true :) I guess&amp;nbsp;I must have&amp;nbsp;mismatched version's or something because&amp;nbsp;the Strataframe addin would not load this morning,&amp;nbsp;I reinstalled back to the latest beta version and that fixed the problem with the add-in but&amp;nbsp;I still&amp;nbsp;have the issue with the record pointer being in the wrong place. &lt;/P&gt;&lt;P&gt;Just curious if the SF guys are looking into this?&lt;BR&gt;</description><pubDate>Wed, 27 Aug 2008 08:28:09 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18767.aspx</link><description>Is there a difference between the source posted in the user accounts section and the latest build that is posted here on the forums? &lt;/P&gt;&lt;P&gt;I needed to get this working ASAP so i just&amp;nbsp;obama rigged&amp;nbsp;my import code to check to make sure it was on the first record after filling , after that i decided to see why it was doing that and&amp;nbsp;to make sure&amp;nbsp;I had the latest source&amp;nbsp;I downloaded it and rebuilt it on my system and then issue was gone,&amp;nbsp;I did not change anything just downloaded and rebuilt it&amp;nbsp;in debug so i could step though.&amp;nbsp;I could be going crazy it has been a long day but I am thinking that is what happened. I'm going to leave well enough alone and get while the getting is good but figured id post this just in case im not crazy.</description><pubDate>Tue, 26 Aug 2008 16:15:12 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18750.aspx</link><description>Any ideas?</description><pubDate>Tue, 26 Aug 2008 12:41:01 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18731.aspx</link><description>Ok now that I know what is happening I really urgently&amp;nbsp;have to fix it as it is holding up a weekly data import, I really don't want to have to go through all the fill methods and make sure the record is in the correct position. &lt;/P&gt;&lt;P&gt;Any ideas on what is causiing this and what needs to be changed to fix it?</description><pubDate>Tue, 26 Aug 2008 08:43:16 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18724.aspx</link><description>Glad&amp;nbsp;I found this post, I have been trying to figure out why a weekly import routine quit working correctly and thought&amp;nbsp;I was crazy cause the BO was starting on the second record. Thanks for finding this one it saved me some&amp;nbsp;time trying to figure out why the record pointer was on the second record.</description><pubDate>Mon, 25 Aug 2008 22:37:47 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18710.aspx</link><description>In BusinessLayer.Events.VB&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
       ''' &lt;summary&gt;&lt;br&gt;
        ''' Raises the MicroFour.StrataFrame.Business.BusinessLayer.CurrentDataTableRefilled event.&lt;br&gt;
        ''' &lt;/summary&gt;&lt;br&gt;
        ''' &lt;remarks&gt;&lt;/remarks&gt;&lt;br&gt;
        Protected Overridable Sub OnCurrentDataTableRefilled()&lt;br&gt;
            RaiseEvent CurrentDataTableRefilled()&lt;br&gt;
            '-- Navigate the record&lt;br&gt;
            Me._CurrentRowIndex -= 1&lt;br&gt;
' This is the line causing it - don't know why this is needed...&lt;br&gt;
            Me.Navigate(BusinessNavigationDirection.Next, 0, Nothing, False, True)&lt;br&gt;
        End Sub&lt;br&gt;
[/codesnippet]</description><pubDate>Fri, 22 Aug 2008 16:56:50 GMT</pubDate><dc:creator>Randy Jean</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18709.aspx</link><description>I wondered what was happening. I've also noticed this, but figured I was doing something wrong.  I made a demo using SF sample data and indeed, it is reproducible.</description><pubDate>Fri, 22 Aug 2008 16:33:52 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18692.aspx</link><description>In the CRM sample app, add a FillAll method to the customer BO (without a movefirst after the filldatatable):&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
   Public Sub FillAll()&lt;br&gt;
        Dim loCommand As New SqlCommand()&lt;br&gt;
&lt;br&gt;
        '-- Create the command&lt;br&gt;
        loCommand.CommandText = "SELECT * FROM Customers Order By Cust_Company"&lt;br&gt;
&lt;br&gt;
        '-- Execute the command&lt;br&gt;
        Me.FillDataTable(loCommand)&lt;br&gt;
        &lt;br&gt;
    End Sub&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
Then, in the customer maintenance form load, call the new fillall method:&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
   Private Sub CustomerMaintenance_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br&gt;
        Customers.FillAll()&lt;br&gt;
    End Sub&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
In my case, when I run the form, I can click the "back" button on the binding navigator and there is indeed a record that it skips back to - but it should actually not be able to skip back if it is indeed on the first record.  If this doesn't happen to you, then I'm not sure what could be different.  It does this on every business object we have and we're not setting any sorts for filters of any kind.  Also running the latest SF beta of 1.6.6 I believe.&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
Randy</description><pubDate>Fri, 22 Aug 2008 14:46:57 GMT</pubDate><dc:creator>Randy Jean</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18682.aspx</link><description>Trent was looking at the code behind this the other day, and the CurrentIndex is indeed getting set right after the filldatatable, so I'm not sure how that could be an issue.&amp;nbsp; &lt;P&gt;However, if it is reproducable, could you post that sample up as an attatchment so we can take a look at it. Ben didn't mention anything to me about it, so he may have already addressed this (he's on vacation at the moment, so I can't just go ask him ;)). Regardless, a sample that uses the StrataFrame Sample info and fails on your end will tell us for sure.</description><pubDate>Fri, 22 Aug 2008 10:02:10 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18654.aspx</link><description>Actually, a movefirst is what we want instead of navigate, I believe.  Navigate tries to update bound controls so don't think that's needed if doing this inside the fill itself.</description><pubDate>Thu, 21 Aug 2008 14:23:55 GMT</pubDate><dc:creator>Randy Jean</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18653.aspx</link><description>This is a re-producible issue that I showed Ben on the last day of training in Amarillo using sample app business objects and he confirmed it definitely was not a filter/sort issue with what I showed him, but immediately after the filldatatable, the currentrowindex was set to the 2nd record (or actually a 1 vs. a 0).  Sure, putting a navigate in the fill method should rectify the issue, but still curious as to what's actually causing this to happen.  I had been meaning to follow-up with Ben but been real busy with some other projects and just getting back to some Strataframe work myself.  This has bitten us a few times but we've managed to just work around it for now.</description><pubDate>Thu, 21 Aug 2008 13:59:42 GMT</pubDate><dc:creator>Randy Jean</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18330.aspx</link><description>Hi Juan Carlos,&lt;/P&gt;&lt;P&gt;Try putting the Navigate() command in the BO.FillTodos(), that way you keep the code related to the BO in the BO in case you need to call BO.FillTodos() from another place and want to have the records properly sorted.</description><pubDate>Tue, 05 Aug 2008 07:08:12 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18328.aspx</link><description>Hi&lt;br&gt;
&lt;br&gt;
Just found the solution:&lt;br&gt;
&lt;br&gt;
    Private Sub FamiliasBO1_ParentFormLoading() Handles FamiliasBO1.ParentFormLoading&lt;br&gt;
        '-- Load BO  &lt;br&gt;
        Me.FamiliasBO1.FillTodos()&lt;br&gt;
&lt;br&gt;
        '-- Go to first record&lt;br&gt;
        FamiliasBO1.Navigate(MicroFour.StrataFrame.Business.BusinessNavigationDirection.First)&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
As the FillTodos is already sorted, I only need to go to the first record. Without that the BO loads ordered but shows the first record in the primary index. Navigate to the first record puts the form just as I need.&lt;br&gt;
&lt;br&gt;
Thanks all for your help.</description><pubDate>Mon, 04 Aug 2008 23:37:11 GMT</pubDate><dc:creator>Juan Carlos Pazos</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18234.aspx</link><description>I promise that this is your problem.&amp;nbsp; If you put a break point you will see that the data behind the CurrentRowIndex is changed....the ONLY way that this will happen is through a filter or a sort or manually changing the data table and/or view.&amp;nbsp; You are welcome to post a sample, but I have seen this too many times in the past and I am confident that is your issue.</description><pubDate>Wed, 30 Jul 2008 17:32:34 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18230.aspx</link><description>Hi Trent&lt;/P&gt;&lt;P&gt;Sorry but I dont' have any sort or filter in the form. As I show before the SELECT statement has a ORDER BY and yes the order is respected when the form loads, the only thing is that the record that shows when the form is opened is the second one and the first one.&lt;/P&gt;&lt;P&gt;I review the forums yes but at least the ones I tale a look was on how&amp;nbsp;to use a SORT or how to after save show the records sorted again.&lt;/P&gt;&lt;P&gt;I will review again, maybe as you said is the CurrentIndex... that goes to the second record and I don't know why?&lt;/P&gt;&lt;P&gt;regards</description><pubDate>Wed, 30 Jul 2008 13:27:51 GMT</pubDate><dc:creator>Juan Carlos Pazos</dc:creator></item><item><title>RE: Order records in a maintenance form</title><link>http://forum.strataframe.net/FindPost18218.aspx</link><description>You can actually find your answer to this throughout the forum....it becomes a common post.&amp;nbsp; You have a sort or filter set on your BO which changes the order of the internal data table, but the CurrentRowIndex is left the same.&amp;nbsp; So when you add a new record or modify a column that is part of the sort or filter, you will either need to clear the sort or filter or take this into account.&amp;nbsp; This is a very common thing that we see out here on the forum, but I am 99.99% confident that you have a filter or sort applied to he BO or something along those lines that is changing the order of the records in the BO.</description><pubDate>Wed, 30 Jul 2008 09:08:08 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>