DataControlActionList
Smart-tag for data-bound controls (ComboBox, ListBox) -- DataSource, DisplayMember, ValueMember properties plus Clear Data Binding action
Table of Contents
Overview
Namespace: TheTechIdea.Beep.Winform.Controls.Design.Server.ActionLists
Inheritance: DesignerActionList | Visibility: public
DataControlActionList provides a reusable data-binding smart-tag for controls that support DataSource, DisplayMember, and ValueMember properties (ComboBox, ListBox, and similar data-bound controls). It uses the IBeepDesignerActionHost interface for property access, making it compatible with both leaf and container designers.
Smart-Tag Properties
| Property | Type | Category | Description |
|---|---|---|---|
| DataSource | object? | Data | Data source for the control. Get/set via _designer.GetProperty/SetProperty. |
| DisplayMember | string | Data | Property/column to display in the control. Delegates to _designer. |
| ValueMember | string | Data | Property/column to use as the selected value. Delegates to _designer. |
All three properties are decorated with [Category("Data")] and descriptive [Description] attributes.
Data Actions
| Action | Description |
|---|---|
| ClearDataBinding() | Sets DataSource to null, DisplayMember to string.Empty, and ValueMember to string.Empty. Use to unbind a control from its data source. |
Smart-Tag Sections
| Section | Items |
|---|---|
| Data Binding | ClearDataBinding (action) |
| Data Properties | DataSource, DisplayMember, ValueMember (3 properties) |
Examples
// At design time, a data-bound ComboBox shows:
// Smart-tag > Data Properties > DataSource = myBindingSource
// Smart-tag > Data Properties > DisplayMember = "Name"
// Smart-tag > Data Properties > ValueMember = "Id"
// Smart-tag > Data Binding > "Clear Data Binding"
// Equivalent at runtime:
combo.DataSource = customerList;
combo.DisplayMember = "FullName";
combo.ValueMember = "CustomerId";
// To clear:
combo.DataSource = null;
combo.DisplayMember = "";
combo.ValueMember = "";