|
Juan Carlos Pazos
|
|
|
Group: Forum Members
Posts: 144,
Visits: 227
|
Hi I have a curious situation. I have a table for families, the BO has this method: Public Sub FillAllRecords()Me.FillDataTable("SELECT * FROM Familias ORDER BY Apellidos")End SubI 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. Regards
Everything is possible, just keep trying...
|
|
|
|
|
Trent Taylor
|
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
You can actually find your answer to this throughout the forum....it becomes a common post. 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. 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. 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.
|
|
|
|
|
Juan Carlos Pazos
|
|
|
Group: Forum Members
Posts: 144,
Visits: 227
|
Hi Trent 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. I review the forums yes but at least the ones I tale a look was on how to use a SORT or how to after save show the records sorted again. I will review again, maybe as you said is the CurrentIndex... that goes to the second record and I don't know why? regards
Everything is possible, just keep trying...
|
|
|
|
|
Trent Taylor
|
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
I promise that this is your problem. 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. 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.
|
|
|
|
|
Juan Carlos Pazos
|
|
|
Group: Forum Members
Posts: 144,
Visits: 227
|
Hi Just found the solution: Private Sub FamiliasBO1_ParentFormLoading() Handles FamiliasBO1.ParentFormLoading '-- Load BO Me.FamiliasBO1.FillTodos() '-- Go to first record FamiliasBO1.Navigate(MicroFour.StrataFrame.Business.BusinessNavigationDirection.First) End Sub 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. Thanks all for your help.
 Everything is possible, just keep trying...
|
|
|
|
|
Edhy Rijo
|
|
|
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
|
Hi Juan Carlos, 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.
Edhy Rijo
|
|
|
|
|
Randy Jean
|
|
|
Group: StrataFrame Users
Posts: 105,
Visits: 641
|
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.
|
|
|
|
|
Randy Jean
|
|
|
Group: StrataFrame Users
Posts: 105,
Visits: 641
|
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.
|
|
|
|
|
Alex Luyando
|
|
|
Group: StrataFrame Users
Posts: 112,
Visits: 1.2K
|
Trent L. Taylor (07/30/2008) You can actually find your answer to this throughout the forum....I never was able to find lots of Easter Eggs buried in the sand either... I give up! Where can I find the answer? 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 It's probably right in front of me, but... TIA
________________ _____/ Regards, ____/ al
|
|
|
|
|
Trent Taylor
|
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
Alex, I guess I don't understand your problem. Your problem could be happening for a lot of reasons, and I don't think I have enough information to give you an answer. Are you using the fully automated population of the ListView including the management of the Add, Edit, Delete buttons? Or are the buttons you are referring to a MaintenanceFormToolstrip? What is changing...when you select a ListView item the toolstrip is updated or when you navigate the ListView selected index is changing?
|
|
|
|