ListBoxExtensions
Wisej.Web.Markup.ListBoxExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.0.0.0)
Adds fluent markup extension methods to the ListBox class.
public class ListBoxExtensions
Methods
HorizontalScrollbar<TListBox>(listBox, value)

Sets the HorizontalScrollbar property of the specified ListBox.
Returns: TListBox. The modified list box with the updated HorizontalScrollbar property.
This method allows you to specify whether a horizontal scrollbar should be shown for the list box.
myListBox.HorizontalScrollbar(true);
IncrementalSelection<TListBox>(listBox, value)

Sets the IncrementalSelection property of the specified ListBox.
Returns: TListBox. The modified list box with the updated IncrementalSelection property.
This method allows you to enable or disable incremental selection for the list box.
myListBox.IncrementalSelection(true);
ItemHeight<TListBox>(listBox, itemHeight)

Sets the ItemHeight property of the specified ListBox.
Returns: TListBox. The modified list box with the updated ItemHeight property.
This method allows you to specify the height of each item in the list box.
myListBox.ItemHeight(20);
Items<TListBox>(listBox, items)

Adds the specified items to the Items collection of the specified ListBox.
Returns: TListBox. The modified list box with the added items.
This method allows you to add multiple items to the list box in one call.
myListBox.Items("Item1", "Item2", "Item3");
LazyLoading<TListBox>(listBox, value)

Sets the LazyLoading property of the specified ListBox.
Returns: TListBox. The modified list box with the updated LazyLoading property.
This method allows you to enable or disable lazy loading for the list box.
myListBox.LazyLoading(true);
OnSelectedIndexChanged<TListBox>(listBox, action)

Attaches an event handler for the SelectedIndexChanged event of the specified ListBox.
Returns: TListBox. The modified list box with the attached SelectedIndexChanged event handler.
This method allows you to execute a custom action whenever the SelectedIndex property of the list box changes.
myListBox.OnSelectedIndexChanged(lb =>
{
AlertBox.Show("Selected index changed!");
});
OnSortedChanged<TListBox>(listBox, action)

Attaches an event handler for the SortedChanged event of the specified ListBox.
Returns: TListBox. The modified list box with the attached SortedChanged event handler.
This method allows you to execute a custom action whenever the Sorted property of the list box changes.
myListBox.OnSortedChanged(lb =>
{
AlertBox.Show("Sorted property changed!");
});
OnToolClick<TListBox>(listBox, action)

Attaches an event handler for the ToolClick event of the specified ListBox.
action
An action to execute when a tool in the list box is clicked.
Returns: TListBox. The modified list box with the attached ToolClick event handler.
This method allows you to execute a custom action whenever a tool in the list box is clicked.
myListBox.OnToolClick((lb, args) =>
{
AlertBox.Show("Tool clicked!");
});
Orientation<TListBox>(listBox, orientation)

Sets the Orientation property of the specified ListBox.
Returns: TListBox. The modified list box with the updated Orientation property.
This method allows you to set the orientation for the list box, which determines how items are displayed.
myListBox.Orientation(Orientation.Horizontal);
RightClickSelection<TListBox>(listBox, value)

Sets the RightClickSelection property of the specified ListBox.
Returns: TListBox. The modified list box with the updated RightClickSelection property.
This method allows you to enable or disable right-click selection for the list box.
myListBox.RightClickSelection(true);
ScrollAlwaysVisible<TListBox>(listBox, value)

Sets the ScrollAlwaysVisible property of the specified ListBox.
Returns: TListBox. The modified list box with the updated ScrollAlwaysVisible property.
This method allows you to ensure the scrollbar is always visible, regardless of the number of items.
myListBox.ScrollAlwaysVisible(true);
SelectedItem<TListBox>(listBox, selectedItem)

Sets the SelectedItem property of the specified ListBox.
Returns: TListBox. The modified list box with the updated SelectedItem property.
This method allows you to specify the selected item in the list box.
myListBox.SelectedItem(item);
SelectionMode<TListBox>(listBox, selectionMode)

Sets the SelectionMode property of the specified ListBox.
Returns: TListBox. The modified list box with the updated SelectionMode property.
This method allows you to specify the selection mode for the list box.
myListBox.SelectionMode(SelectionMode.MultiExtended);
Sorted<TListBox>(listBox, value)

Sets the Sorted property of the specified ListBox.
Returns: TListBox. The modified list box with the updated Sorted property.
This method allows you to specify whether the items in the list box should be sorted automatically.
myListBox.Sorted(true);
Tools<TListBox>(listBox, items)

Adds the specified tools to the Tools collection of the specified ListBox.
Returns: TListBox. The modified list box with the added tools.
This method allows you to add multiple tools to the list box in one call.
myListBox.Tools(tool1, tool2, tool3);
TopIndex<TListBox>(listBox, topIndex)

Sets the TopIndex property of the specified ListBox.
Returns: TListBox. The modified list box with the updated TopIndex property.
This method allows you to specify the index of the first visible item in the list box.
myListBox.TopIndex(5);
Last updated
Was this helpful?