Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting the current row
Message
From
30/07/2003 03:33:42
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00814578
Message ID:
00814817
Views:
10
<--Try adding this to the button's click event handler:


this.NavigateData(mmNavigate.Last, false);

This is the code that is used for the mmMaintenaceForm's New button -->

Still I have a problem. First, the method does not accept a 2nd parameter, but no problem. Second, If I'm sorting on a column other than the primary key, I get in the wrong position.

After debugging your code (and thank God we have it), I notice that you're issuing a new row on the dataset itself. Then, keeping a reference to the new row (It actually wasn't, but I fixed this bug). The binding manager, on the other hand, is using dataviews, and I'm struggling to find a way to locate the row representation in the dataview. I cannot even determine its position in the table itself!

A workaround to this would be, using the CurrencyManager's AddNew() method (If not suggesting creating one of our own, which is better). This will add a new row to the dataview and set the current record to the new position. Now, what happens to the business object? Well simply, you could hook events to whatever dataset's table assigned to the business object. Then call the appropriate operations from there. This will eliminate some problems, when for example, the user sets the current dataset to one of his own and then using a backdoor call to insert a new row to that dataset without using the NewRow method of the business object.

What do you think?

Thanks
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform