Me.UltraGrid1.DisplayLayout.Bands(0).Columns.Add("CalculatedColumn", "Calculated Value")
You can add an unbound column to the WinGrid™. This is useful for displaying calculations based on other fields in the row, or for placing check boxes into the grid so users can select multiple rows.
For more information on adding calculated columns to the WinGrid, see the WinCalcManager tutorial, Creating a Calculated Column in WinGrid.
There are two ways to add an unbound column to the grid. At Design-time, you can use the custom property pages. At run-time, you can add a column using the Columns Collection of a Band.
Open the grid Designer by right clicking on the grid and selecting UltraWinGrid Designer from the context menu.
Expand the Band and Column Settings.
Expand the node for the appropriate Band, then click the Columns node under that band.
A list of columns will be displayed on the right. At the bottom of the list will be a button labeled "Add Unbound Column". Click this button.
To add the column in code, access the Add method of the Columns Collection specifying a key value for the new column. You can optionally specify a caption to be displayed in the column’s header.
In Visual Basic:
Me.UltraGrid1.DisplayLayout.Bands(0).Columns.Add("CalculatedColumn", "Calculated Value")
In C#:
this.ultraGrid1.DisplayLayout.Bands[0].Columns.Add("CalculatedColumn", "Calculated Value");
The most common use of creating an unbound column is to perform a calculation based on other columns and show the result in the unbound column.