| Infragistics.WebUI.UltraWebGrid Namespace > UltraGridColumn Class : DataType Property (UltraGridColumn) |
The Type of the column.
[Visual Basic]
Public Property DataType As String[C#]
public string DataType {get; set;}A string representation of the fully-qualified Type.
This is a fully-qualified Type name that includes the Common Language namespace. It is similar to what would be returned by the FullName property within the .NET Framework. This property does not contain assembly reference information. It therefore cannot disambiguate between versions of the same Type, or Types with identical full names.
All UltraGridColumns default to the type System.String, if no other DataType is specified or inferred.
This function checks is a style has been applied to a column. If the column does not have a cell style applied it sets some style properties.
[Visual Basic]
Private Sub SetStype()
' Check if the column had a style property set on the cells
If UltraWebGrid1.Bands(0).Columns(0).HasCellStyle = False Then
' Set the cell's style to a custom class defined in an external CSS file
UltraWebGrid1.Bands(0).Columns(0).CellStyle.CssClass = "CellClass"
' Change the background image of the column's cells to a custom image
UltraWebGrid1.Bands(0).Columns(0).CellStyle.BackgroundImage = "Images/Background.Gif"
' Set the cell to clip overflow text with a ...
UltraWebGrid1.Bands(0).Columns(0).CellStyle.TextOverflow = Infragistics.WebUI.UltraWebGrid.TextOverflow.Ellipsis
' Right align all of the text in the cell
UltraWebGrid1.Bands(0).Columns(0).CellStyle.HorizontalAlign = HorizontalAlign.Right
' Default any new values to 0
UltraWebGrid1.Bands(0).Columns(0).DefaultValue = "0"
' Make any null values appear in the grid as 0
UltraWebGrid1.Bands(0).Columns(0).NullText = "0"
' Set the column data type to an integer
UltraWebGrid1.Bands(0).Columns(0).DataType = "System.Int32"
' Merge like values that are next to each other into one large
' column
UltraWebGrid1.Bands(0).Columns(0).MergeCells = True
End If
End Sub