fix select and input components
This commit is contained in:
parent
13d3b1c1b2
commit
1ca6980b3a
@ -28,7 +28,7 @@ namespace FormsTesting
|
||||
|
||||
private void InitializeInputComponent()
|
||||
{
|
||||
InputComponent.IntValue = 1848;
|
||||
InputComponent.IntValue = 1500;
|
||||
}
|
||||
|
||||
private void InitializeGridComponent()
|
||||
|
@ -43,13 +43,9 @@ namespace ShabComponentsLibrary
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value is null)
|
||||
SetNullState(value is null, true);
|
||||
if (value is not null)
|
||||
{
|
||||
SetNullState(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetNullState(false);
|
||||
MainTextBox.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
@ -66,16 +62,8 @@ namespace ShabComponentsLibrary
|
||||
|
||||
private void SetNullState(bool IsNull, bool ClearText = false)
|
||||
{
|
||||
if (IsNull)
|
||||
{
|
||||
IsNullCheckBox.Checked = true;
|
||||
MainTextBox.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsNullCheckBox.Checked = false;
|
||||
MainTextBox.Enabled = true;
|
||||
}
|
||||
IsNullCheckBox.Checked = IsNull;
|
||||
MainTextBox.Enabled = !IsNull;
|
||||
|
||||
if (ClearText)
|
||||
{
|
||||
|
@ -95,13 +95,6 @@
|
||||
Grid.Rows[NewRowIndex].Cells[Column.Index].Value = Value;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (DataGridViewColumn Column in Grid.Columns)
|
||||
{
|
||||
var Property = Properties.FirstOrDefault(x => x.Name == Column.Name);
|
||||
if (Property == null)
|
||||
throw new InvalidOperationException($"В типе {Type.Name} не найдено свойство с именем {Column.Name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user