Method DefaultGetItemText
DefaultGetItemText(object?, bool, IFormatProvider?)
Returns a string representation of the specified item, using display or value text as appropriate.
public static string DefaultGetItemText(object? item, bool forDisplay, IFormatProvider? formatProvider = null)
Parameters
itemobjectThe item to convert to a string. Can be null.
forDisplaybooltrue to use display text if available; otherwise, false to use value text.
formatProviderIFormatProviderAn object that supplies culture-specific formatting information, or null to use the current culture.
Returns
- string
A string representation of the item. Returns an empty string if the item is null.
Remarks
If the item is a ListControlItem, the method returns the DisplayText, Text, or Value property, depending on the forDisplay parameter and property availability. For other types, the method uses the item's ToString implementation with the specified format provider.