FlexGrid for WinForms
DataType Property (RowCol)



Gets or sets the type of object stored in this row or column.
Syntax
'Declaration
 
<C1CategoryAttribute("Layout")>
<C1DescriptionAttribute("Gets or sets the type of object stored in this row or column.")>
<RefreshPropertiesAttribute(RefreshProperties.Repaint)>
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)>
<DefaultValueAttribute()>
<TypeConverterAttribute("C1.Win.C1FlexGrid.Design.GridDataTypeConverter, C1.Win.C1FlexGrid.4.Design")>
Public Overridable Property DataType As Type
'Usage
 
Dim instance As RowCol
Dim value As Type
 
instance.DataType = value
 
value = instance.DataType
[C1Category("Layout")]
[C1Description("Gets or sets the type of object stored in this row or column.")]
[RefreshProperties(RefreshProperties.Repaint)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[DefaultValue()]
[TypeConverter("C1.Win.C1FlexGrid.Design.GridDataTypeConverter, C1.Win.C1FlexGrid.4.Design")]
public virtual Type DataType {get; set;}
[C1Category("Layout")]
[C1Description("Gets or sets the type of object stored in this row or column.")]
[RefreshProperties(RefreshProperties.Repaint)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[DefaultValue()]
[TypeConverter("C1.Win.C1FlexGrid.Design.GridDataTypeConverter, C1.Win.C1FlexGrid.4.Design")]
public:
virtual property Type^ DataType {
   Type^ get();
   void set (    Type^ value);
}
Remarks

By default, the column's DataType property is set to System.Object, which allows you to store any data values in the column.

If you set a row or column's DataType to a specific type, the grid will try to convert any values assigned to cells in that column to the specified data type. If the conversion fails, the grid will fire a GridError event and the cell value will not be changed.

The DataType property affects how values are stored internally in the grid, how they are sorted, and the type of control that is used to edit the values in the column. For example, a System.Windows.Forms.DateTimePicker control is used to edit values in System.DateTime columns, and check boxes are used to display and edit values in Boolean columns.

If you want to store times (not dates) in a column, you can still use the DateTime type, but you should use a Format that displays only the time, not the date.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

RowCol Class
RowCol Members

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Send Feedback