Method GetItemText
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
containerIListControlItemContainerThe container that provides access to item text retrieval methods.
itemIndexint?The zero-based index of the item whose text to retrieve, or null to use the specified item instance.
itemListControlItemThe item instance whose text to retrieve if itemIndex is null. If both itemIndex and item are null, an empty string is returned.
forDisplaybooltrue to retrieve the text formatted for display; otherwise, false to retrieve the raw value.
formatProviderIFormatProviderAn 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.