Spread Windows Forms 9.0 Product Documentation
DataField Property (Column)
Example 


Gets or sets the data field for this column in the data source.
Syntax
'Declaration
 
Public Property DataField As String
'Usage
 
Dim instance As Column
Dim value As String
 
instance.DataField = value
 
value = instance.DataField
public string DataField {get; set;}

Property Value

String containing the name of the data field
Example
This example illustrates the use of this member by returning the data field for the column.
FarPoint.Win.Spread.Column col;
col = fpSpread1.ActiveSheet.Columns[0];
string conStr  = "Provider=Microsoft.JET.OLEDB.4.0;data source=D:\\nwind.mdb";
string sqlStr = "SELECT * FROM Orders";
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(conStr);
DataSet ds = new DataSet();
System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter(sqlStr, conn);
da.Fill(ds, "Orders");
fpSpread1.DataSource = ds;
listBox1.Items.Add(col.DataField);
Dim col As FarPoint.Win.Spread.Column
col = FpSpread1.ActiveSheet.Columns(0)
Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=D:\\nwind.mdb"
Dim sqlStr As String = "SELECT * FROM Orders"
Dim conn As New System.Data.OleDb.OleDbConnection(conStr)
Dim ds As DataSet = New DataSet()
Dim da As New System.Data.OleDb.OleDbDataAdapter(sqlStr, conn)
da.Fill(ds, "Orders")
FpSpread1.DataSource = ds
ListBox1.Items.Add(col.DataField)
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

Column Class
Column Members

 

 


Copyright © GrapeCity, inc. All rights reserved.