Spread for ASP.NET 13 Product Documentation
FarPoint.Web.Spread.Extender Assembly / FarPoint.Web.Spread.Extender Namespace / AjaxComboBoxCellType Class / DataTextField Property
Example


In This Topic
    DataTextField Property (AjaxComboBoxCellType)
    In This Topic
    Gets or sets the data source field that provides the text content of the list items.
    Syntax
    'Declaration
     
    Public Property DataTextField As String
    'Usage
     
    Dim instance As AjaxComboBoxCellType
    Dim value As String
     
    instance.DataTextField = value
     
    value = instance.DataTextField
    public string DataTextField {get; set;}
    Example
    This example sets the DataTextField property.
    System.Data.DataSet data = new System.Data.DataSet("data");
    data.Tables.Add("Table1");
    data.Tables["table1"].Columns.Add("dataText");
    data.Tables["table1"].Columns.Add("dataValue");
    data.Tables["table1"].Rows.Add("WinSpread", "1");
    data.Tables["table1"].Rows.Add("WebSpread", "2");
    data.AcceptChanges();
    
    FarPoint.Web.Spread.Extender.AjaxComboBoxCellType combo = new FarPoint.Web.Spread.Extender.AjaxComboBoxCellType();
    combo.ShowEditor = true;
    combo.DataSource = data;
    combo.DataMember = "table1";
    combo.DataTextField = "dataText";
    combo.DataValueField = "dataValue";
    FpSpread1.Sheets[0].Cells[0, 0].CellType = combo;
    Dim data As New System.Data.DataSet("data")
    data.Tables.Add("Table1")
    data.Tables("table1").Columns.Add("dataText")
    data.Tables("table1").Columns.Add("dataValue")
    data.Tables("table1").Rows.Add("WinSpread", "1")
    data.Tables("table1").Rows.Add("WebSpread", "2")
    data.AcceptChanges()
    
    Dim combo As New FarPoint.Web.Spread.Extender.AjaxComboBoxCellType()
    combo.ShowEditor = True
    combo.DataSource = data
    combo.DataMember = "table1"
    combo.DataTextField = "dataText"
    combo.DataValueField = "dataValue"
    FpSpread1.Sheets(0).Cells(0, 0).CellType = combo
    See Also