Refresh still not working

6 posts, 0 answers
  1. Shaggy
    Shaggy avatar
    8 posts
    Member since:
    Jul 2013

    Posted 18 Oct 2013 Link to this post


    i have a Gridview which is bind with a table adapter to a database. On this form i have a button for deleting records and it works very well. When i'm deleting a record and i'm refill the table adapter i immediately see the changes.

    But here's the problem. When i'm trying to insert a new user from a another form (not that one, where the gridview is), then the changes are not updated.

    I've tried to Refresh the MasterTemplate from the other form, but that doenst work. Also i placed a sub on the form with the gridview and tried to call it from the other form, but that doenst works neither.

    But when i place a button on the original form where the gridview is and i fire the sub with the button, the changes are working well!

    Can anybody help me with this issue?

  2. erwin
    erwin avatar
    401 posts
    Member since:
    Dec 2006

    Posted 19 Oct 2013 Link to this post

    Hey Shaggy,

    you didnt' tell how the insert action is implemented.

    Generally speaking, you have to refresh the data that the grid is bound to and the grid will automatically update.

    if the code behind your insert button modifies the same datasource the grid is bound to, the grid will be notified and update.

    Calling refresh on the grid will not requery the database. That you will have to do on the datasource bound to the grid.



  3. Shaggy
    Shaggy avatar
    8 posts
    Member since:
    Jul 2013

    Posted 21 Oct 2013 Link to this post

    Hello Erwin,

    thank's for your answer, but it doesnt helps me. I try to explain my problem a little more.

    On a form a i have a GridView which is bound to a table in the database. The table is bound to a Table Adapter, which i fill on load (see Code).

    I also have a button on that form, to delete a record from the database, and that works fine.

    Public Sub User_Load()
      'A public sub for loading the Table Adapter
    End Sub
    Private Sub frmMain_Load(sender as Object, e as EventArgs) Handles MyBase.Load
    End Sub
    Private Sub Button1_Click(sender as Object, e as EventArgs) Handles RadButton1.Click
      'Deleting a specific Row from the Database with a function in a class
      Dim sql As New clSQL
      'Reloading the table adtapter
    End Sub

    So i needed also the opportunity to add a new line to the datagrid, so i added a new form, where you can fill the fields you need in the grid. When i now call the Sub User_Load from the new form, nothing happens.

    When i'm placing a "refresh" button on the main form and i'm calling the same sub it also works fine.

    I don't get this :-/

    Thanks for help!
  4. Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    4059 posts

    Posted 23 Oct 2013 Link to this post

    Hello Shaggy,

    Thank you for writing back,

    When you have RadGridView bound to data table, it is not necessary to add/delete rows from the database and then to synchronize the grid by refilling the table adapter. You may add/delete rows directly using the RadGridView. This will modify the data-set and the table adapter. Please find attached a sample project. 

    Still, as Erwin mentioned, if you modify the data and fill the table adapter with it, the grid will automatically refresh.

    I hope this information helps. Should you have further questions, I would be glad to help.

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  5. Barry
    Barry avatar
    3 posts
    Member since:
    Jul 2014

    Posted 05 Oct 2016 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hello I am new to Telerik and running a trial of the latest version of the winforms UI. I am using radgridview but I can't get my back end data to update either, in my case an update. I am calling the update method of my tableadapter and passing in the dataset as the argument to the update method, but it doesn't work. When I step through the call to the update method, with f11 in Visual Studio it just steps over it as if I used step over - f10.

    I downloaded the posted sample project, but it looks like it is referencing a different / older version of telerik UI. and I can't get it to work.

    Also, I am confused about the differences between doing this with a regular native winforms grid and radgridview. I have test code that works with a regular grid. I am also confused as to whether the data source should be the bindingsource, or the tables in the dataset? The radgrid seems to work identically in either case, but in both cases the backend data won't update.

    Here the update data code from my save button click:


                MessageBox.Show("Click OK to begin accept changes");
                MessageBox.Show("ACCEPT changes of data set is done");



  6. Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    4059 posts

    Posted 10 Oct 2016 Link to this post

    Hello David,

    Thank you for writing.  

    Please refer to the following help article demon strating how to stor ethe changes in your database:

    I hope this information helps. Should you have further questions I would be glad to help.

    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Back to Top