Hi,I have a strange problem because of one line of code and I can't see why. Basically, when I use the BO.Sort method it causes the UI refresh of the BO bindings to fail when a new record is added. When the BO.Sort line is removed, it works correctly.
I have a very simple SF maintenance form with a single BO and a single textbox bound to a field. In the ParentFormLoading I have the following code:-
bo1.FillAll();
// Set sort order
bo1.Sort = "CODE";
bo1.Navigate(MicroFour.StrataFrame.Business.BusinessNavigationDirection.First);
When the form loads the textbox correctly shows the first record and the navigation tools work correctly. However, when a new record is added the textbox always shows the value from the very first record instead of the new blank record - regardless of which record I was on at the time the New button was clicked. For example, if I navigate to the 10th record and click New, the textbox suddenly shows the value from the 1st record. When I click Save with no data entry, the textbox shows an empty value and for the first time the UI is set to the new record - it looks like the UI databindings are only refreshed during the Save operation.
I have checked in the AfterAddNew BO method and the new record is correctly added and is the current record. However, the UI always shows the very 1st record until the Save is actioned.
When I remove the bo1.Sort line the problem goes away.
I can build the sort into the BO Fill SQL command but I would be interested to know what I have done wrong.Thanks in advance,
Aaron