ListControlExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.1.0.0)
Adds fluent markup extension methods to the ListControl class.
- C#
- VB.NET
public class ListControlExtensions
Public Class ListControlExtensions
Methods
AllowHtml<TListControl>(listControl, value)
Sets the AllowHtml property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the AllowHtml property. |
| value | Boolean | A boolean indicating whether HTML content is allowed in the list items. |
Returns: TListControl. The modified list control with the updated AllowHtml property.
This method allows you to enable or disable HTML content in the list items.
myListControl.AllowHtml(true);
BorderStyle<TListControl>(listControl, borderStyle)
Sets the BorderStyle property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the BorderStyle property. |
| borderStyle | BorderStyle | The BorderStyle value to set for the list control. |
Returns: TListControl. The modified list control with the updated BorderStyle property.
This method allows you to set the border style for the list control.
myListControl.BorderStyle(BorderStyle.FixedSingle);
DataSource<TListControl>(listControl, value)
Sets the DataSource property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the DataSource property. |
| value | Object | The data source to bind to the list control. |
Returns: TListControl. The modified list control with the updated DataSource property.
This method allows you to set the data source for the list control.
myListControl.DataSource(myDataSource);
DisplayMember<TListControl>(listControl, value)
Sets the DisplayMember property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the DisplayMember property. |
| value | String | The property to display for the list items. |
Returns: TListControl. The modified list control with the updated DisplayMember property.
This method allows you to set the property to display for the list items.
myListControl.DisplayMember("Name");
FormatInfo<TListControl>(listControl, provider)
Sets the FormatInfo property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the FormatInfo property. |
| provider | IFormatProvider | The IFormatProvider to use for formatting the list items. |
Returns: TListControl. The modified list control with the updated FormatInfo property.
This method allows you to set the format provider for the list control.
myListControl.FormatInfo(CultureInfo.CurrentCulture);
FormatString<TListControl>(listControl, format)
Sets the FormatString property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the FormatString property. |
| format | String | The format string to use for displaying the list items. |
Returns: TListControl. The modified list control with the updated FormatString property.
This method allows you to set the format string for the list control.
myListControl.FormatString("C2");
FormattingEnabled<TListControl>(listControl, value)
Sets the FormattingEnabled property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the FormattingEnabled property. |
| value | Boolean | A boolean indicating whether formatting is enabled for the list items. |
Returns: TListControl. The modified list control with the updated FormattingEnabled property.
This method allows you to enable or disable formatting for the list control.
myListControl.FormattingEnabled(true);
IconMember<TListControl>(listControl, value)
Sets the IconMember property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the IconMember property. |
| value | String | The property to use as the icon for the list items. |
Returns: TListControl. The modified list control with the updated IconMember property.
This method allows you to set the property to use as the icon for the list items.
myListControl.IconMember("IconPath");
Invalid<TListControl>(listControl, value)
Sets the Invalid property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the Invalid property. |
| value | Boolean | A boolean indicating whether the list control is in an invalid state. |
Returns: TListControl. The modified list control with the updated Invalid property.
This method allows you to set the invalid state for the list control.
myListControl.Invalid(true);
InvalidMessage<TListControl>(listControl, message)
Sets the InvalidMessage property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the InvalidMessage property. |
| message | String | The message to display when an invalid operation occurs in the list control. |
Returns: TListControl. The modified list control with the updated InvalidMessage property.
This method allows you to set a custom invalid message for the list control.
myListControl.InvalidMessage("Invalid selection.");
OnSelectedValueChanged<TListControl>(listControl, action)
Attaches an event handler for the SelectedValueChanged event of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control to attach the event handler to. |
| action | Action<TListControl> | An action to execute when the SelectedValue property changes. |
Returns: TListControl. The modified list control with the attached SelectedValueChanged event handler.
This method allows you to execute a custom action whenever the SelectedValue property of the list control changes.
myListControl.OnSelectedValueChanged(lc =>
{
AlertBox.Show("Selected value changed!");
});
PrefetchItems<TListControl>(listControl, count)
Sets the PrefetchItems property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the PrefetchItems property. |
| count | Int32 | The number of items to prefetch for the list control. |
Returns: TListControl. The modified list control with the updated PrefetchItems property.
This method allows you to set the number of items to prefetch for the list control.
myListControl.PrefetchItems(50);
SelectedIndex<TListControl>(listControl, value)
Sets the SelectedIndex property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the SelectedIndex property. |
| value | Int32 | The index to select in the list control. |
Returns: TListControl. The modified list control with the updated SelectedIndex property.
This method allows you to set the selected index for the list control.
myListControl.SelectedIndex(0);
SelectedValue<TListControl>(listControl, value)
Sets the SelectedValue property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the SelectedValue property. |
| value | Object | The value to select in the list control. |
Returns: TListControl. The modified list control with the updated SelectedValue property.
This method allows you to set the selected value for the list control.
myListControl.SelectedValue(someValue);
ShowToolTips<TListControl>(listControl, value)
Sets the ShowToolTips property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the ShowToolTips property. |
| value | Boolean | A boolean indicating whether tooltips should be shown for the list items. |
Returns: TListControl. The modified list control with the updated ShowToolTips property.
This method allows you to enable or disable tooltips for the list items.
myListControl.ShowToolTips(true);
ToolTipMember<TListControl>(listControl, value)
Sets the ToolTipMember property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the ToolTipMember property. |
| value | String | The property to use as the tooltip for the list items. |
Returns: TListControl. The modified list control with the updated ToolTipMember property.
This method allows you to set the property to use as the tooltip for the list items.
myListControl.ToolTipMember("Description");
ValueMember<TListControl>(listControl, value)
Sets the ValueMember property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the ValueMember property. |
| value | String | The property to use as the value for the list items. |
Returns: TListControl. The modified list control with the updated ValueMember property.
This method allows you to set the property to use as the value for the list items.
myListControl.ValueMember("ID");
VirtualScroll<TListControl>(listControl, value)
Sets the VirtualScroll property of the specified ListControl.
| Parameter | Type | Description |
|---|---|---|
| TListControl | The type of the list control, must inherit from ListControl. | |
| listControl | TListControl | The list control for which to set the VirtualScroll property. |
| value | Boolean | A boolean indicating whether virtual scrolling is enabled for the list control. |
Returns: TListControl. The modified list control with the updated VirtualScroll property.
This method allows you to enable or disable virtual scrolling for the list control.
myListControl.VirtualScroll(true);