We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

When datasource is changed skip of the previous state remains and doesn't get reset

Hi,

When datasource is changed skip of the previous state remains and doesn't get reset.

Thanks,
John

1 Reply

HJ Hariharan J V Syncfusion Team April 10, 2019 04:17 PM UTC

Hi John, 

Query: When datasource is changed skip of the previous state remains and doesn't get reset. 
 
By default, when dynamically assign data source it automatically refresh the Grid. If the dynamic data source does not contain the same field (initial data then it show blank row) then we suggest you to define the column property before changing the data source as follows. 

Please check the below code example for more information. 

// dynamically apply data source for Grid 
var grid = document.getElementsByClassName("e-grid")[0].ej2_instances[0]; 
// you can either define the column as below or put [] so it considered as auto generated column 
 
grid.columns=[{field:'OrderID1'}]; 
grid.dataSource = data2; 



Regards, 
Hariharan 


Loader.
Live Chat Icon For mobile
Up arrow icon