From f6139c713ad8d60ec9eb4b455ab0edc1fd6444ae Mon Sep 17 00:00:00 2001 From: Gabor Apati-Nagy Date: Mon, 25 Jul 2016 11:51:33 +0100 Subject: [PATCH] CA-213728: Going to Home Server tab can change home server Even though the correct row have been selected by the time the grid becomes visible, it is not displayed properly. This change set fixes the problem by selecting the row again. Signed-off-by: Gabor Apati-Nagy --- XenAdmin/Controls/AffinityPicker.Designer.cs | 1 + XenAdmin/Controls/AffinityPicker.cs | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/XenAdmin/Controls/AffinityPicker.Designer.cs b/XenAdmin/Controls/AffinityPicker.Designer.cs index b6f6266ed..556860878 100644 --- a/XenAdmin/Controls/AffinityPicker.Designer.cs +++ b/XenAdmin/Controls/AffinityPicker.Designer.cs @@ -109,6 +109,7 @@ namespace XenAdmin.Controls this.ReasonColumn}); resources.ApplyResources(this.ServersGridView, "ServersGridView"); this.ServersGridView.Name = "ServersGridView"; + this.ServersGridView.VisibleChanged += new System.EventHandler(this.ServersGridView_VisibleChanged); // // ImageColumn // diff --git a/XenAdmin/Controls/AffinityPicker.cs b/XenAdmin/Controls/AffinityPicker.cs index d708b9419..0597bad37 100644 --- a/XenAdmin/Controls/AffinityPicker.cs +++ b/XenAdmin/Controls/AffinityPicker.cs @@ -216,6 +216,17 @@ namespace XenAdmin.Controls else ServersGridView.Select(); } + + bool selectedOnVisibleChanged = false; + + private void ServersGridView_VisibleChanged(object sender, EventArgs e) + { + if (!selectedOnVisibleChanged) + { + selectedOnVisibleChanged = true; + SelectSomething();//CA-213728 + } + } } internal class ServerGridRow : DataGridViewExRow