Infragistics2.Win.UltraWinListView.v8.1
ItemDoubleClick Event
See Also  Example
Infragistics.Win.UltraWinListView Namespace > UltraListView Class : ItemDoubleClick Event

Occurs after the value of the UltraListViewItem.CheckState property of an UltraListViewItem has been changed.

Syntax

Visual Basic (Declaration) 
Public Event ItemDoubleClick() As ItemDoubleClickEventHandler
C# 
public event ItemDoubleClickEventHandler ItemDoubleClick()

Remarks

The UltraListView control does not expose an 'ItemClick' event; use the UltraListView.ItemActivated event if your application requires a notification when the end user navigates to a different UltraListViewItem.

Example

The following code sample demonstrates how the UltraListView's ItemDoubleClick event can be handled to perform an action, such as opening a file, when an UltraListViewItem is double-clicked:

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Visual BasicCopy Code
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinListView

    Private Sub ultraListView1_ItemDoubleClick(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinListView.ItemDoubleClickEventArgs) Handles ultraListView1.ItemDoubleClick

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

            Dim fileInfo As FileInfo = CType(e.Item.Tag, System.IO.FileInfo)
            If Not fileInfo Is Nothing AndAlso fileInfo.Extension.ToLower() = ".txt" Then
                Dim psi As ProcessStartInfo = New ProcessStartInfo("notepad.exe", fileInfo.FullName)
                Process.Start(psi)
            End If

        End If

    End Sub
C#Copy Code
using Infragistics.Win;
using Infragistics.Win.UltraWinListView;
using System.Diagnostics;


       
private void ultraListView1_ItemDoubleClick(object sender, Infragistics.Win.UltraWinListView.ItemDoubleClickEventArgs e)
       {
           FileInfo fileInfo = e.Item.Tag
as FileInfo;
           
if ( fileInfo != null && fileInfo.Extension.ToLower() == ".txt" )
           {
               ProcessStartInfo psi =
new ProcessStartInfo( "notepad.exe", fileInfo.FullName );
               Process.Start( psi );
           }
       }

See Also