ListViewItem.ItemType 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
ListViewItem 개체의 항목 형식을 가져옵니다.
public:
property System::Web::UI::WebControls::ListViewItemType ItemType { System::Web::UI::WebControls::ListViewItemType get(); };
public System.Web.UI.WebControls.ListViewItemType ItemType { get; }
member this.ItemType : System.Web.UI.WebControls.ListViewItemType
Public ReadOnly Property ItemType As ListViewItemType
속성 값
ListViewItemType 값 중 하나입니다.
예제
다음 예제에서는 사용 하는 방법의 ItemType 항목이 생성 되는 데이터 항목을 확인 하는 속성입니다. 데이터 항목을 항목을 사용 하는 경우 전자 메일 주소를 기울임꼴로 표시 됩니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 ListViewItem 클래스입니다.
protected void ContactsListView_ItemCreated(object sender, ListViewItemEventArgs e)
{
// Retrieve the current item.
ListViewItem item = e.Item;
// Verify if the item is a data item.
if (item.ItemType == ListViewItemType.DataItem)
{
// Get the EmailAddressLabel Label control in the item.
Label EmailAddressLabel = (Label)item.FindControl("EmailAddressLabel");
// Display the email address in italics.
EmailAddressLabel.Font.Italic = true;
}
}
Protected Sub ContactsListView_ItemCreated(ByVal sender As Object, ByVal e As ListViewItemEventArgs)
' Retrieve the current item.
Dim item As ListViewItem = e.Item
' Verify if the item is a data item.
If item.ItemType = ListViewItemType.DataItem Then
' Get the EmailAddressLabel Label control in the item.
Dim EmailAddressLabel As Label = CType(item.FindControl("EmailAddressLabel"), Label)
' Display the email address in italics.
EmailAddressLabel.Font.Italic = True
End If
End Sub
설명
사용 하 여 합니다 ItemType 속성의 형식을 결정 하는 항목을 ListViewItem 다음 표에 나열 된 개체 나타냅니다.
항목 유형 | Description |
---|---|
DataItem | ListView 컨트롤의 데이터 항목입니다. |
InsertItem | ListView 컨트롤에 있는 삽입 항목입니다. |
EmptyItem | ListView 컨트롤에 있는 빈 항목입니다. 빈 항목이 표시 됩니다 때 합니다 ListView 컨트롤에 표시할 레코드가 없는 그룹에 또는 ListView 컨트롤에 표시할 레코드가 더 이상 없습니다. |
일반적으로 작업을 수행 하기 전에 항목의 형식을 확인 하려면이 속성을 사용 합니다.