mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 06:16:37 +01:00
Merge pull request #1503 from letsboogey/gpu
CP-21558 - On the vGPU types dialog, hide the column headers where al…
This commit is contained in:
commit
3a83bba457
@ -102,6 +102,8 @@ namespace XenAdmin.Controls.GPU
|
||||
.ToArray());
|
||||
}
|
||||
SetCheckedValues();
|
||||
HideColumnIfEmpty(MaxResolutionColumn);
|
||||
HideColumnIfEmpty(MaxDisplaysColumn);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@ -153,6 +155,22 @@ namespace XenAdmin.Controls.GPU
|
||||
? Messages.GPU_RUBRIC_PLEASE_SELECT_WHICH_GPU_ONE
|
||||
: Messages.GPU_RUBRIC_PLEASE_SELECT_WHICH_GPU_MULTIPLE;
|
||||
}
|
||||
|
||||
private void HideColumnIfEmpty(DataGridViewColumn column)
|
||||
{
|
||||
bool columnEmpty = true;
|
||||
foreach (DataGridViewRow row in dataGridViewEx1.Rows)
|
||||
{
|
||||
var value = row.Cells[column.Name].Value;
|
||||
if (!String.IsNullOrEmpty((string)value))
|
||||
{
|
||||
columnEmpty = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (columnEmpty)
|
||||
dataGridViewEx1.Columns[column.Name].Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
class VGpuDetailWithCheckBoxRow : DataGridViewExRow
|
||||
|
Loading…
Reference in New Issue
Block a user