Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Telerik gridview : How to refresh grid view after Database change

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 ?

like image 776
Rsh Avatar asked Dec 27 '22 03:12

Rsh


1 Answers

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

this.radGridViewName.MasterTemplate.Refresh(null); 

this line solved my problem :-)

like image 155
Priyanka Avatar answered Dec 29 '22 12:12

Priyanka