| | |
| | | { |
| | | cbo.DataSource = dataSource; |
| | | cbo.DisplayMember = display; |
| | | if (!string.IsNullOrWhiteSpace(value)) |
| | | { |
| | | cbo.ValueMember = value; |
| | | } |
| | | } |
| | | |
| | | public static void SetCombo(ToolStripComboBox cbo, object dataSource, string display, string value) |
| | | { |
| | | cbo.ComboBox.DataSource = dataSource; |
| | | cbo.ComboBox.DisplayMember = display; |
| | | if (!string.IsNullOrWhiteSpace(value)) |
| | | { |
| | | cbo.ComboBox.ValueMember = value; |
| | | } |
| | | } |
| | | |
| | | public static void SetCombo(DataGridViewComboBoxColumn cbo, object dataSource, string display, string value) |
| | | { |
| | | cbo.DataSource = dataSource; |
| | | cbo.DisplayMember = display; |
| | | if (!string.IsNullOrWhiteSpace(value)) |
| | | { |
| | | cbo.ValueMember = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | #region DataGridView设置列头为复选框 |
| | | public class DataGridViewCheckboxHeaderEventArgs : EventArgs |