Skip to main content
Version: 4.1

ListControlExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.1.0.0)

Adds fluent markup extension methods to the ListControl class.

public class ListControlExtensions

Methods

Static member AllowHtml<TListControl>(listControl, value)

Sets the AllowHtml property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the AllowHtml property.
valueBooleanA 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);

Static member BorderStyle<TListControl>(listControl, borderStyle)

Sets the BorderStyle property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the BorderStyle property.
borderStyleBorderStyleThe 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);

Static member DataSource<TListControl>(listControl, value)

Sets the DataSource property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the DataSource property.
valueObjectThe 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);

Static member DisplayMember<TListControl>(listControl, value)

Sets the DisplayMember property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the DisplayMember property.
valueStringThe 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");

Static member FormatInfo<TListControl>(listControl, provider)

Sets the FormatInfo property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the FormatInfo property.
providerIFormatProviderThe 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);

Static member FormatString<TListControl>(listControl, format)

Sets the FormatString property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the FormatString property.
formatStringThe 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");

Static member FormattingEnabled<TListControl>(listControl, value)

Sets the FormattingEnabled property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the FormattingEnabled property.
valueBooleanA 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);

Static member IconMember<TListControl>(listControl, value)

Sets the IconMember property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the IconMember property.
valueStringThe 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");

Static member Invalid<TListControl>(listControl, value)

Sets the Invalid property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the Invalid property.
valueBooleanA 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);

Static member InvalidMessage<TListControl>(listControl, message)

Sets the InvalidMessage property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the InvalidMessage property.
messageStringThe 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.");

Static member OnSelectedValueChanged<TListControl>(listControl, action)

Attaches an event handler for the SelectedValueChanged event of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control to attach the event handler to.
actionAction<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!");
});

Static member PrefetchItems<TListControl>(listControl, count)

Sets the PrefetchItems property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the PrefetchItems property.
countInt32The 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);

Static member SelectedIndex<TListControl>(listControl, value)

Sets the SelectedIndex property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the SelectedIndex property.
valueInt32The 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);

Static member SelectedValue<TListControl>(listControl, value)

Sets the SelectedValue property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the SelectedValue property.
valueObjectThe 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);

Static member ShowToolTips<TListControl>(listControl, value)

Sets the ShowToolTips property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the ShowToolTips property.
valueBooleanA 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);

Static member ToolTipMember<TListControl>(listControl, value)

Sets the ToolTipMember property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the ToolTipMember property.
valueStringThe 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");

Static member ValueMember<TListControl>(listControl, value)

Sets the ValueMember property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the ValueMember property.
valueStringThe 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");

Static member VirtualScroll<TListControl>(listControl, value)

Sets the VirtualScroll property of the specified ListControl.

ParameterTypeDescription
TListControlThe type of the list control, must inherit from ListControl.
listControlTListControlThe list control for which to set the VirtualScroll property.
valueBooleanA 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);