Spread Windows Forms 7.0 Product Documentation
ItemData Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > ComboBoxCellType Class : ItemData Property


Glossary Item Box

Gets or sets the corresponding data for the items in the drop-down list in the combo box.

Syntax

Visual Basic (Declaration) 
Public Property ItemData As String()
Visual Basic (Usage)Copy Code
Dim instance As ComboBoxCellType
Dim value() As String
 
instance.ItemData = value
 
value = instance.ItemData
C# 
public string[] ItemData {get; set;}

Property Value

String array with data corresponding to the items

Example

This example gets and sets item data.
C#Copy Code
FarPoint.Win.Spread.CellType.ComboBoxCellType combo = new FarPoint.Win.Spread.CellType.ComboBoxCellType();

private void Form1_Load(object sender, System.EventArgs e)
{        
      string[] cbstr;
      cbstr = new String[] {"One", "Two", "Three"};
      string[] strval;
      strval = new String[] {"1", "2", "3"};
      combo.Items = cbstr;
      combo.ItemData = strval;
      combo.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.ItemData;
      fpSpread1.Sheets[0].Cells[0, 0].CellType = combo;
}

private void fpSpread1_ComboSelChange(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
{
      textBox1.Text = fpSpread1.Sheets[0].Cells[0, 0].Value.ToString();
}
Visual BasicCopy Code
Dim combo As New FarPoint.Win.Spread.CellType.ComboBoxCellType()

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim cbstr As String()
        cbstr = New String() {"One", "Two", "Three"}
        Dim strval As String()
        strval = New String() {"1", "2", "3"}
        combo.Items = cbstr
        combo.ItemData = strval
        combo.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.ItemData
        FpSpread1.Sheets(0).Cells(0, 0).CellType = combo
End Sub


Private Sub FpSpread1_ComboSelChange(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.EditorNotifyEventArgs) Handles
FpSpread1.ComboSelChange
        TextBox1.Text = FpSpread1.Sheets(0).Cells(0, 0).Value
End Sub

Requirements

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

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.