General information
Category:
The Mere Mortals .NET Framework
Title:
Navigation grid changes row on cancel
Kevin,
MM.NET ver. 1.3 Beta 4
In my form (based on my subclass of mmBusinessForm) I have a grid (grdList) which is set as the navigation control with
' Register the grdList DataGrid as the Navigation control
Me.NavControl = Me.grdList
I also have form.DisplayNavigationToolbar = ToolBarOnMainForm
I make a change to data in the current row and then attempt to navigate off the row before clicking the Save button by left mouse clicking on the Main form tool bar "Next" button. When the AskSaveChanges dialog comes up I select Cancel. The cancel works and the highlight on grdList stays on the current row. Everything works fine.
If I make the same edit but attempt to move off the current row by left mouse clicking on another row in the grdList grid control and again select Cancel from the AskSaveChanges dialog the edits do not save but the grid highlight moves. This happens with both Multiselect = True and Multiselect = False.
The problem seems to be in mmBusinessForm.NavigateData()
public override void NavigateData(mmNavigate navPosition, bool raiseEvents)
...
if (this.IsChanged())
{
...
// Ask the user if they want to save changes
DialogResult result = this.AskSaveChanges();
...
if (result == DialogResult.Cancel)
{
return;
}
If the user selects Cancel the code does a return. It appears that there is no mechanism in place to restore the row highlight to it's pre-click position. Indeed since NavigateData() has no return value and no output parms I can't think of an easy override to correct this shortcoming.
Am I missing something here?
Can you please provide a fix for this?
Thanks,
Max...
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only