Infragistics2.Win.UltraWinListView.v8.1
Value Property
See Also  Example
Infragistics.Win.UltraWinListView Namespace > UltraListViewItemBase Class : Value Property

Returns the value for this UltraListViewItemBase instance.

Syntax

Visual Basic (Declaration) 
Public Property Value As Object
C# 
public object Value {get; set;}

Example

The following code sample demonstrates how to populate the UltraListView's Items collection from the 'Orders' table in the Northwind database:

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

    Private Sub PopulateItemsCollection(ByVal ordersTable As DataTable)

        Dim dataRow As DataRow
        Dim dataColumn As DataColumn

        ' Populate the Items collection from the Rows collection of the 'Orders' table.
        For Each dataRow In ordersTable.Rows

            ' Add an UltraListViewItem for this order, using the value of the
            ' 'OrderID' field for the item's Value
            Dim orderItem As UltraListViewItem = Me.ultraListView1.Items.Add(Nothing, dataRow("OrderID"))

            ' Set the values for the UltraListViewItem's SubItems. Note that we
            ' can use an UltraListViewSubItemColumn instance to index into the
            ' SubItemColumns collection, and use the stored reference to the underlying
            ' DataColumn to index into the DataRow's columns.
            Dim subItemColumn As UltraListViewSubItemColumn
            For Each subItemColumn In Me.ultraListView1.SubItemColumns

                DataColumn = CType(subItemColumn.Tag, DataColumn)
                Dim subItem As UltraListViewSubItem = orderItem.SubItems(subItemColumn)
                subItem.Value = dataRow(DataColumn)

                ' Assign the Appearance we created for this shipper to the
                ' UltraListViewSubItem's Appearance.
                If subItem.Key = "ShipVia" Then subItem.Appearance = Me.ultraListView1.Appearances(subItem.Text)
            Next

            ' Assign the UltraListViewGroup which represents this order's customer
            ' to the item's Group property.
            Dim customerID As String = CType(dataRow("CustomerID"), String)
            orderItem.Group = Me.ultraListView1.Groups(customerID)
        Next

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


       
private void PopulateItemsCollection( DataTable ordersTable )
       {
           
//    Populate the Items collection from the Rows collection of the 'Orders' table.
           
foreach( DataRow dataRow in ordersTable.Rows )
           {
               
//    Add an UltraListViewItem for this order, using the value of the
               
//    'OrderID' field for the item's Value
               
UltraListViewItem orderItem = this.ultraListView1.Items.Add( null, dataRow["OrderID"] );

               
//    Set the values for the UltraListViewItem's SubItems. Note that we
               
//    can use an UltraListViewSubItemColumn instance to index into the
               
//    SubItemColumns collection, and use the stored reference to the underlying
               
//    DataColumn to index into the DataRow's columns.
               
foreach( UltraListViewSubItemColumn subItemColumn in this.ultraListView1.SubItemColumns )
               {
                   DataColumn dataColumn = subItemColumn.Tag
as DataColumn;
                   UltraListViewSubItem subItem = orderItem.SubItems[subItemColumn];
                   subItem.Value = dataRow[dataColumn];

                   
//    Assign the Appearance we created for this shipper to the
                   
//    UltraListViewSubItem's Appearance.
                   
if ( subItem.Key == "ShipVia" )
                       subItem.Appearance =
this.ultraListView1.Appearances[subItem.Text];
               }

               
//    Assign the UltraListViewGroup which represents this order's customer
               
//    to the item's Group property.
               
string customerID = dataRow["CustomerID"] as string;
               orderItem.Group =
this.ultraListView1.Groups[customerID];
           }
       }

See Also