fix select and input components

This commit is contained in:
ShabOl 2024-09-11 11:44:28 +04:00
parent 13d3b1c1b2
commit 1ca6980b3a
3 changed files with 5 additions and 24 deletions

View File

@ -28,7 +28,7 @@ namespace FormsTesting
private void InitializeInputComponent()
{
InputComponent.IntValue = 1848;
InputComponent.IntValue = 1500;
}
private void InitializeGridComponent()

View File

@ -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)
{

View File

@ -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}");
}
}
}
}