バージョン

UIElement プロパティ (UltraListViewItem)

シンタックス
'宣言
 
Public ReadOnly Property UIElement As UltraListViewItemUIElement
public UltraListViewItemUIElement UIElement {get;}
使用例
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinListView

    Private Sub ultraListView1_ItemEnteringEditMode(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinListView.ItemEnteringEditModeEventArgs) Handles ultraListView1.ItemEnteringEditMode

        '	If the item represents a DataRow that has been deleted,
        '	cancel the event to prevent edit mode from being entered.
        If e.Item.Tag.GetType() Is GetType(DataRow) Then

            Dim dataRow As DataRow = CType(e.Item.Tag, DataRow)
            If (dataRow.RowState = DataRowState.Deleted) Then
                e.Cancel = True
            End If
        End If

    End Sub

    Private Sub ultraListView1_ItemEnteredEditMode(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinListView.ItemEnteredEditModeEventArgs) Handles ultraListView1.ItemEnteredEditMode

        '	If the embeddable editor for this item supports a dropdown,
        '	call the DropDown method.
        Dim embeddableElement As EmbeddableUIElementBase = e.Item.UIElement.GetDescendant(GetType(EmbeddableUIElementBase), e.Item)
        Dim editor As EmbeddableEditorBase = IIf(Not embeddableElement Is Nothing, embeddableElement.Editor, Nothing)

        If (Not editor Is Nothing AndAlso editor.SupportsDropDown) Then
            editor.DropDown()
        End If

    End Sub

    Private Sub ultraListView1_ItemExitingEditMode(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinListView.ItemExitingEditModeEventArgs) Handles ultraListView1.ItemExitingEditMode

        '	If changes are to be applied, and the item that was edited
        '	represents a FileInfo object, make sure that the file does
        '	not exist - if it does, cancel the event and display a message.
        If e.ApplyChanges Then

            If e.Item.Tag.GetType() Is GetType(System.IO.FileInfo) Then

                Dim fileInfo As System.IO.FileInfo = CType(e.Item.Tag, System.IO.FileInfo)
                Dim newFileName As String = String.Format("{0}\{1}", fileInfo.DirectoryName, e.Editor.CurrentEditText)
                If System.IO.File.Exists(newFileName) Then

                    Dim message As String = String.Format("Cannot rename {0}: A file with the name you specified already exists. Specify a different file name.", e.Editor.CurrentEditText)
                    MessageBox.Show(message, "Error Renaming File or Folder", MessageBoxButtons.OK, MessageBoxIcon.Error)
                    e.Cancel = True

                End If
            End If
        End If

    End Sub

    Private Sub ultraListView1_ItemExitedEditMode(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinListView.ItemExitedEditModeEventArgs) Handles ultraListView1.ItemExitedEditMode

        '	If the item that was edited represents a FileInfo object,
        '	refresh the file system object information.
        If e.Item.Tag.GetType() Is GetType(System.IO.FileInfo) Then

            Dim fileInfo As System.IO.FileInfo = CType(e.Item.Tag, System.IO.FileInfo)
            Me.RefreshFileSystemObject(e.Item)
        End If
    End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinListView;
using System.Diagnostics;

		private void ultraListView1_ItemEnteringEditMode(object sender, Infragistics.Win.UltraWinListView.ItemEnteringEditModeEventArgs e)
		{
			//	If the item represents a DataRow that has been deleted,
			//	cancel the event to prevent edit mode from being entered.
			if ( e.Item.Tag is DataRow )
			{
				DataRow dataRow = e.Item.Tag as DataRow;
				if ( dataRow.RowState == DataRowState.Deleted )
					e.Cancel = true;
			}
		}

		private void ultraListView1_ItemEnteredEditMode(object sender, Infragistics.Win.UltraWinListView.ItemEnteredEditModeEventArgs e)
		{
			//	If the embeddable editor for this item supports a dropdown,
			//	call the DropDown method.
			EmbeddableUIElementBase embeddableElement = e.Item.UIElement.GetDescendant( typeof(EmbeddableUIElementBase), e.Item ) as EmbeddableUIElementBase;
			EmbeddableEditorBase editor = embeddableElement != null ? embeddableElement.Editor : null;
			
			if ( editor != null && editor.SupportsDropDown )
				editor.DropDown();
		}

		private void ultraListView1_ItemExitingEditMode(object sender, Infragistics.Win.UltraWinListView.ItemExitingEditModeEventArgs e)
		{
			//	If changes are to be applied, and the item that was edited
			//	represents a FileInfo object, make sure that the file does
			//	not exist; if it does, cancel the event and display a message.
			if ( e.ApplyChanges )
			{
				if ( e.Item.Tag is System.IO.FileInfo )
				{
					System.IO.FileInfo fileInfo = e.Item.Tag as System.IO.FileInfo;
					string newFileName = string.Format( @"{0}\{1}", fileInfo.DirectoryName, e.Editor.CurrentEditText );
					if ( System.IO.File.Exists(newFileName) )
					{
						string message = string.Format( "Cannot rename {0}: A file with the name you specified already exists. Specify a different file name.", e.Editor.CurrentEditText );
						MessageBox.Show( message, "Error Renaming File or Folder", MessageBoxButtons.OK, MessageBoxIcon.Error );
						e.Cancel = true;
					}
				}
			}
		}

		private void ultraListView1_ItemExitedEditMode(object sender, Infragistics.Win.UltraWinListView.ItemExitedEditModeEventArgs e)
		{
			//	If the item that was edited represents a FileInfo object,
			//	refresh the file system object information.
			if ( e.Item.Tag is System.IO.FileInfo )
			{
				System.IO.FileInfo fileInfo = e.Item.Tag as System.IO.FileInfo;
				this.RefreshFileSystemObject( e.Item );
			}
		}
参照