Принятая 1 лаба
This commit is contained in:
parent
29ef211385
commit
9b30023ed6
@ -93,10 +93,20 @@ namespace Components
|
||||
|
||||
var properties = typeof(T).GetProperties();
|
||||
|
||||
foreach (var obj in objects)
|
||||
for (int i = 0; i < objects.Count; ++i)
|
||||
{
|
||||
var values = properties.Select(p => p.GetValue(obj, null)).ToArray();
|
||||
dataGridView.Rows.Add(values);
|
||||
var row = objects[i];
|
||||
dataGridView.Rows.Add();
|
||||
|
||||
for (int j = 0; j < dataGridView.ColumnCount; ++j)
|
||||
{
|
||||
var property = properties.FirstOrDefault(p => p.Name == dataGridView.Columns[j].DataPropertyName);
|
||||
|
||||
if (property != null)
|
||||
{
|
||||
dataGridView.Rows[i].Cells[j].Value = property.GetValue(row, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,16 +45,8 @@ namespace Components
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.HasValue)
|
||||
{
|
||||
checkBoxNull.Checked = false;
|
||||
textBoxInteger.Text = value.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
checkBoxNull.Checked = true;
|
||||
textBoxInteger.Text = string.Empty;
|
||||
}
|
||||
checkBoxNull.Checked = !value.HasValue;
|
||||
textBoxInteger.Text = value.HasValue ? value.ToString() : string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user