Telerik gridview : How to refresh grid view after Database change

Rsh picture Rsh · May 17, 2013 · Viewed 24.6k times · Source

I'm using radgridview in C# winform application to show data from database. I'm also altering database through ADO.Net. The problem is after I change the database, for example by deleting a row or adding a new row, changes do not appear in gridview.
I also want to mention that I have bound database to gridview through smart tags and when I tried to create a new dataset and assign it to radgridview1.datasource I got tons of errors.
Any suggestion on how can force radgridview to reload it's datasource ?

Answer

Priyanka picture Priyanka · Dec 14, 2013

When datasource get changes, to refresh datagrid use following code :

this.radGridViewName.MasterTemplate.Refresh(null); 

this line solved my problem :-)