ItemsControl.ItemStringFormat Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a composite string that specifies how to format the items in the ItemsControl if they are displayed as strings.
public:
property System::String ^ ItemStringFormat { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Bindable(true)]
public string ItemStringFormat { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.ItemStringFormat : string with get, set
Public Property ItemStringFormat As String
Property Value
A composite string that specifies how to format the items in the ItemsControl if they are displayed as strings.
- Attributes
Examples
The following example uses the ItemStringFormat to specify the format of a list of DateTime objects.
<ListBox xmlns:sys="clr-namespace:System;assembly=mscorlib"
ItemStringFormat="MMMM d, yyyy">
<sys:DateTime>2004/3/4</sys:DateTime>
<sys:DateTime>2004/8/9</sys:DateTime>
<sys:DateTime>2005/10/14</sys:DateTime>
<sys:DateTime>2005/4/8</sys:DateTime>
</ListBox>
<!--The results when the default culture is en-US:
March 4, 2004
August 9, 2004
October 14, 2005,
April 8, 2005-->
Remarks
ItemStringFormat can be a predefined, composite, or custom string format. For more information about string formats, see Formatting Types. If you set the ItemTemplate or ItemTemplateSelector of a ItemsControl, the ItemStringFormat property is ignored.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기