Items in the dbicList control are objects of the type Dbi.WinControl.dbiNodeItem and are stored in the dbicList’s Items collection. Items can be added/edited/deleted in design-time using the Items designer built in to the control. The Items designer is accessed by using the Edit Items selection in the dbicList Tasks menu (click on the arrow in the upper right hand corner of the control when it is selected in the design surface) or by clicking the ellipse button (…) in the Items selection in the property inspector for the control. Items can also be added or modified at runtime programmatically by interacting with the control’s Items collection’s dbiNodeItem objects. Items are stored as text strings with the column values separated by a delimiter (by default a semi-colon). Typically, items in the list represent records in a table or query. Accordingly, the field values for the records are converted to their text equivalents and concatenated along with the delimiter string to create the text for the item, and then the item is added to the list. Alternatively values for columns can be set individually in an item using the dbiNodeItem’s SetCellText method. NOTE: Using the SetCellText method to set column values individually in an item can cause degradation in performance when loading the control.
The following example illustrates the programmatic addition of an item to a list with six columns; one of each data type allowed for a column.
Example:
VB.NET
'Create variables to simulate field values
Dim stringValue As String
Dim integerValue As Integer
Dim booleanValue As Boolean
Dim realValue As Double
Dim imageValue As Integer
Dim datetimeValue As DateTime
'Set the values for each of the columns in the item.
stringValue = "Text"
integerValue = 1234
booleanValue = False
realValue = 1234.321
'NOTE: The image value refers to the index of the image in the attached image list.
imageValue = 2
datetimeValue = DateTime.Now
'Create the column text for the item.
'NOTE: For the purpose of this example the dbicList has been set up with six columns
'one for each data type; Text;Integer;Boolean;Real;Image;DateTime
Dim textString As String
textString = stringValue + ";" + _
integerValue.ToString() + ";" + _
booleanValue.ToString() + ";" + _
realValue.ToString() + ";" + _
imageValue.ToString() + ";" + _
datetimeValue.ToString()
'Create a new nodeItem
Dim dbicListItem As New Dbi.WinControl.dbiNodeItem
'Set the text property of the nodeItem to the textString created above
dbicListItem.Text = textString
'Add the new nodeItem to the dbicList's column collection
Me.dbicList.Items.Add(dbicListItem)
C#
//Create variables to simulate field values
string stringValue;
Int32 integerValue;
Boolean booleanValue;
Double realValue;
Int32 imageValue;
DateTime datetimeValue;
//Set the values for each of the columns in the item.
stringValue = "Text";
integerValue = 1234;
booleanValue = false;
realValue = 1234.321;
//NOTE: The image value refers to the index of the image in the attached image list.
imageValue = 2;
datetimeValue = DateTime.Now;
//Create the column text for the item.
//NOTE: For the purpose of this example the dbicList has been set up with six columns
//one for each data type; Text;Integer;Boolean;Real;Image;DateTime
string textString;
textString = stringValue + ";" +
integerValue.ToString() + ";" +
booleanValue.ToString() + ";" +
realValue.ToString() + ";" +
imageValue.ToString() + ";" +
datetimeValue.ToString();
//Create a new nodeItem
Dbi.WinControl.dbiNodeItem dbicListItem = new Dbi.WinControl.dbiNodeItem();
//Set the text property of the nodeItem to the textString created above
dbicListItem.Text = textString;
//Add the new nodeItem to the dbicList's column collection
this.dbicList1.Items.Add(dbicListItem);