Table of Contents

Method GetItemText

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

GetItemText(IListControlItemContainer?, int?, ListControlItem?, bool, IFormatProvider?)

Retrieves the display text for a list control item, using either the item index or the item instance.

public static string GetItemText(IListControlItemContainer? container, int? itemIndex, ListControlItem? item, bool forDisplay, IFormatProvider? formatProvider = null)

Parameters

container IListControlItemContainer

The container that provides access to item text retrieval methods.

itemIndex int?

The zero-based index of the item whose text to retrieve, or null to use the specified item instance.

item ListControlItem

The item instance whose text to retrieve if itemIndex is null. If both itemIndex and item are null, an empty string is returned.

forDisplay bool

true to retrieve the text formatted for display; otherwise, false to retrieve the raw value.

formatProvider IFormatProvider

An object that supplies culture-specific formatting information, or null to use the current culture. If container is specified, it's format provider is used.

Returns

string

A string containing the item's text. Returns an empty string if both itemIndex and item are null.