Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select 2nd instead of 3rd cell on MarkAllUpdatesToolButton_Click #2704

Merged
merged 1 commit into from
Mar 27, 2019

Conversation

DasSkelett
Copy link
Member

@DasSkelett DasSkelett commented Mar 25, 2019

Problem

After the MarkAllUpdatesToolButton is clicked, the modlist scrolls to the top by selecting the third (index 2) cell of the first row.
With v1.26, this column is no longer the mod name, but the replace checkbox.
If this one is hidden, CKAN throws an error (because you cant select hidden cells, and it is in most cases):

System.InvalidOperationException: Die aktuelle Zelle kann nicht auf eine unsichtbare Zelle festgelegt werden.
   bei System.Windows.Forms.DataGridView.set_CurrentCell(DataGridViewCell value)
   bei CKAN.Main.MarkAllUpdatesToolButton_Click(Object sender, EventArgs e)
   bei System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   bei System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   bei System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   bei System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   bei System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ToolStrip.WndProc(Message& m)
   bei System.Windows.Forms.MenuStrip.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Solution

Now the second cell instead of the third cell is selected, which is shown if there are updates available (otherwise you can't even click the button to mark all updatable mods), and which can't be hidden by the user, so the same error can't repeat with other columns.

Fixes #2703

@politas politas merged commit 7982d99 into KSP-CKAN:master Mar 27, 2019
@DasSkelett DasSkelett deleted the fix/markUpdatesCrash branch April 5, 2019 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PRE-RELEASE 2] "Add available updates" crashes CKAN
2 participants