-
Notifications
You must be signed in to change notification settings - Fork 18
SelectItemForm
Radu Martin edited this page Apr 14, 2017
·
46 revisions
SelectItemForm is a dialogue form which is using for select an item from lists such as IEnumerable or DataTable. Also, the SelectItemForm has ability to search items by criteria.
var items = new Dictionary<int, string>();
items.Add(1, "First value");
items.Add(2, "Second value");
items.Add(3, "More values...");
using (var form = SelectItemForm.CreateFormWithoutColumns(
items, "My values", "These values are mine"))
{
form.dataGrid.AddTextColumn("key", "Key").SetNumberStyle();
form.dataGrid.AddTextColumn("value", "Value").SetAutoSizeFillStyle(50);
form.ShowDialog();
}

In additional, SelectItemForm provides methods for setting text on Header and Footer:
public void SetHeaderText(string Text)
public void SetFooterText(string Text)
The main static method for selecting an item from IEnumerable:
public static T GetSelectedRow<T>(
string Text, string HeaderText,
IEnumerable<T> DataSource, T SelectedRow,
params SelectItemForm.ColumnDefinition[] Columns)
The main static method for selecting DataRow from typed or untyped DataTable:
public static T GetSelectedRow<T>(
DataTable DataSource, T SelectedRow,
params SelectItemForm.ColumnDefinition[] Columns)
where T : DataRow
The main static method for selecting untyped DataRow from any DataSource:
public static DataRow GetSelectedRow(
object DataSource,
string ValueMember = null,
string DisplayMember = null,
object SelectedValue = null,
bool AutoGenerateColumns = false)
The main static method for showing data from any DataSource:
public static DialogResult
ShowData(
object DataSource,
string Text, string HeaderText,
params SelectItemForm.ColumnDefinition[] Columns)
Extenders:
DataGridView
DataGridViewColumn
FlowLayoutPanel
TableLayoutPanel
Features:
SelectItemForm
Settings
Components:
BitMaskCheckedListBox
HeaderTableLayoutPanel
SelectItemForm