How to Rebind Data to SfDataGrid

Could you provide source code, where on a button click, i can rebind the data to an already loaded SfDataGrid.

1 Reply

SS Sivaraman Sivagurunathan Syncfusion Team January 29, 2018 11:16 AM UTC

Hi Joseph, 
 
Thanks for using Syncfusion support. 
 
We have checked your query. you can rebind the data to already loaded SfDataGrid by changing  ItemsSource for SfDataGrid. we have prepared sample ad attached for your reference you can download the same from the below link. 
 
The below code illustrate how to change the item source at run time. 
 
 
private void Button_Clicked(object sender, EventArgs e) 
{ 
   dataGrid.ItemsSource = viewModel.Products; 
} 
 
 
 
 
Regards, 
Sivaraman 
 


Loader.
Up arrow icon