Spread WPF Documentation
ReloadBindingData Method
Example 


GrapeCity.Windows.SpreadSheet.Data Namespace > Worksheet Class : ReloadBindingData Method
Reloads the binding data.
Syntax
'Declaration
 
Public Sub ReloadBindingData() 
'Usage
 
Dim instance As Worksheet
 
instance.ReloadBindingData()
public void ReloadBindingData()
Example
This example uses the ReloadBindingData method.
System.Data.DataTable dt = new System.Data.DataTable("Test");
System.Data.DataRow dr = default(System.Data.DataRow);
dt.Columns.Add("Series0");
dt.Columns.Add("Series1");
dr = dt.NewRow();
dr[0] = 2;
dr[1] = 1;
dt.Rows.Add(dr);    
dr = dt.NewRow();
dr[0] = 4;
dr[1] = 2;
dt.Rows.Add(dr);    
dr = dt.NewRow();
dr[0] = 3;
dr[1] = 4;
gcSpreadSheet1.Sheets[0].AutoGenerateColumns = true;
gcSpreadSheet1.Sheets[0].DataSource = dt;
gcSpreadSheet1.Invalidate();

 private void Button_Click(object sender, RoutedEventArgs e)
{
    DataRow row = dt.NewRow();
    row[0] = 5;
    row[1] = 6;
    dt.Rows.Add(row);
        gcSpreadSheet1.Sheets[0].ReloadBindingData();
        gcSpreadSheet1.Invalidate();
}
Dim dt As New System.Data.DataTable("Test")
        Dim dr As System.Data.DataRow
        dt.Columns.Add("Series0")
        dt.Columns.Add("Series1")
        dr = dt.NewRow()
        dr(0) = 2
        dr(1) = 1
        dt.Rows.Add(dr)
        dr = dt.NewRow()
        dr(0) = 4
        dr(1) = 2
        dt.Rows.Add(dr)
        dr = dt.NewRow()
        dr(0) = 3
        dr(1) = 4
        dt.Rows.Add(dr)
        GcSpreadSheet1.Sheets(0).AutoGenerateColumns = True
        GcSpreadSheet1.Sheets(0).DataSource = dt
        GcSpreadSheet1.Invalidate()

Private Sub Button_Click(sender As System.Object, e As System.Windows.RoutedEventArgs)
    Dim row As System.Data.DataRow
        row = dt.NewRow()
        row(0) = 5
        row(1) = 6
        dt.Rows.Add(row)
        GcSpreadSheet1.Sheets(0).ReloadBindingData()
        GcSpreadSheet1.Invalidate()
    End Sub
See Also

Reference

Worksheet Class
Worksheet Members