GrapeCity.Windows.SpreadSheet.Data Namespace > Worksheet Class : SetDataSource Method |
'Declaration Public Sub SetDataSource( _ ByVal dataSource As System.Object, _ ByVal reset As System.Boolean _ )
'Usage Dim instance As Worksheet Dim dataSource As System.Object Dim reset As System.Boolean instance.SetDataSource(dataSource, reset)
public void SetDataSource( System.object dataSource, System.bool reset )
public class lname { public string last { get; set; } public int val { get; set; } public lname(string last, int val) { this.last = last; this.val = val; } } private void Window_Loaded(object sender, RoutedEventArgs e) { lname[] arr = new lname[] { new lname("Smith", 100), new lname("Fender", 3), new lname("Gill", 5) }; gcSpreadSheet1.Sheets[0].SetDataSource(arr, false); gcSpreadSheet1.Invalidate(); }
Public Class lname Public Property last() As String Get Return m_last End Get Set(value As String) m_last = Value End Set End Property Private m_last As String Public Property val() As Integer Get Return m_val End Get Set(value As Integer) m_val = Value End Set End Property Private m_val As Integer Public Sub New(last As String, val As Integer) Me.last = last Me.val = val End Sub End Class Public Sub New() InitializeComponent() Dim arr As lname() = New lname() {New lname("Smith", 100), New lname("Fender", 3), New lname("Gill", 5)} GcSpreadSheet1.Sheets(0).SetDataSource(arr, False) End Sub
Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6