C2026-043-Tech-Debt_v1 - Stash 1
This commit is contained in:
@@ -24,6 +24,7 @@ namespace Volian.Controls.Library
|
||||
};
|
||||
|
||||
private DataTable values;
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping bindingSource flexible")]
|
||||
private BindingSource bindingSource = null;
|
||||
private int totalrows = 1;
|
||||
private int totalcols = 1;
|
||||
@@ -104,8 +105,10 @@ namespace Volian.Controls.Library
|
||||
|
||||
void FormLoad_setDefaults(object sender, EventArgs e)
|
||||
{
|
||||
BindingSource bindingSourceDropDown = new BindingSource();
|
||||
bindingSourceDropDown.DataSource = Enum.GetNames(typeof(EPinputtype));
|
||||
BindingSource bindingSourceDropDown = new BindingSource
|
||||
{
|
||||
DataSource = Enum.GetNames(typeof(EPinputtype))
|
||||
};
|
||||
|
||||
//in order to achieve a dropdown of possible values need
|
||||
//to remove the auto-inserted columns
|
||||
@@ -114,8 +117,10 @@ namespace Volian.Controls.Library
|
||||
for (int c = 0; c < totalcols; c++)
|
||||
{
|
||||
dataview.Columns.RemoveAt(c);
|
||||
var cName = new DataGridViewComboBoxColumn();
|
||||
cName.DataSource = bindingSourceDropDown;
|
||||
var cName = new DataGridViewComboBoxColumn
|
||||
{
|
||||
DataSource = bindingSourceDropDown
|
||||
};
|
||||
cName.DefaultCellStyle.NullValue = "none";
|
||||
dataview.Columns.Insert(c, cName);
|
||||
}
|
||||
@@ -200,8 +205,10 @@ namespace Volian.Controls.Library
|
||||
int endNumCols = (int)NumCols.Value;
|
||||
int curNumCols = totalcols;
|
||||
|
||||
BindingSource bindingSourceDropDown = new BindingSource();
|
||||
bindingSourceDropDown.DataSource = Enum.GetNames(typeof(EPinputtype));
|
||||
BindingSource bindingSourceDropDown = new BindingSource
|
||||
{
|
||||
DataSource = Enum.GetNames(typeof(EPinputtype))
|
||||
};
|
||||
|
||||
//remove cols till equal
|
||||
while (curNumCols > endNumCols)
|
||||
@@ -215,8 +222,10 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
values.Columns.Add(new DataColumn($"Column{curNumCols + 1}") { DefaultValue = "none"});
|
||||
if (dataview.Columns.Count > curNumCols) dataview.Columns.RemoveAt(curNumCols);
|
||||
var cName = new DataGridViewComboBoxColumn();
|
||||
cName.DataSource = bindingSourceDropDown;
|
||||
var cName = new DataGridViewComboBoxColumn
|
||||
{
|
||||
DataSource = bindingSourceDropDown
|
||||
};
|
||||
cName.DefaultCellStyle.NullValue = "none";
|
||||
dataview.Columns.Add(cName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user