Gridview refresh problem

6 posts, 0 answers
  1. liviu
    liviu avatar
    14 posts
    Member since:
    Mar 2007

    Posted 09 Aug 2007 Link to this post

    Hi!

    I have two tables with a master/detail relationship in a database.
    On a form, for each table i have a gridview to manipulate the data. When I navigate throw the master gridview, the refresh of the detail gridview  doesn't seem to work. Most of the time, the real data has nothing to do with what the detail gridview shows.

    I hope for a rapid solution. Thanks.

  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 10 Aug 2007 Link to this post

    Hello liviu,

    Thank you for the reported issue. The bug was confirmed and logged in our bug tracker. Your Telerik points have been updated as well.

    Currently, we can suggest the following workaround:
     
    protected override OnLoad(EventArgs e) 
       base.OnLoad(e); 
       radGridViewMaster.CurrentRowChanged +=new CurrentRowChangedEventHandler(radGridView1_CurrentRowChanged); 
     
    private void radGridView1_CurrentRowChanged(object sender, CurrentRowChangedEventArgs e) 
       radGridViewDetail.MasterGridViewInfo.UpdateView(true); 

    We hope that this solution will work for you until we fix the issue in the Q2 release.

     
    Regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. liviu
    liviu avatar
    14 posts
    Member since:
    Mar 2007

    Posted 27 Sep 2007 Link to this post


    Hi!

    I got the Q2, suspended the workaround and I was expecting the GridViews to work properly. They didn't.

    Was I supposed to do something more?

    Regards
  5. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 27 Sep 2007 Link to this post

    Hi Liviu,

    In order to use a RadGridView in this scenario you must create a child view and bind it to the detail grid for every change of  the master row:

     
    private void radGridView1_CurrentRowChanged(object sender, CurrentRowChangedEventArgs e) 
        DataRowView row = e.CurrentRow.DataBoundItem as DataRowView; 
        radGridView2.DataSource = row.CreateChildView(nwindDataSet.Orders.ParentRelations[0]); 

    Another approach is using RadGridView in hierarchical mode.

    I hope this was helpful.

    Kind regards,
    Julian Benkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. liviu
    liviu avatar
    14 posts
    Member since:
    Mar 2007

    Posted 28 Sep 2007 Link to this post

    Hi!

    Not exactly the answer I was waiting for. The previous response from your team suggested that it will be an automatic behaviour for this situation. You are giving me just another workaround.

    About the solution using the CurrentRowChanged event.... This event doesn't seem to be fired when a new row is added. So, if I add a row in the master grid, the refresh for the detail grid will not be done.

    About the hierarchical mode.... It doesn't seem to be the design I am looking for, but I have anyway a question.  Using this mode, is it posible to add rows into the detail grid? In your example, I couldn't find a way to do this.

    Regards
  7. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 28 Sep 2007 Link to this post

    Hi Liviu,

    Up to your questions:

    1. We are sorry for the misunderstanding. This behavior is not automatic in RadGridView. Actually, it is not automatic for most grids on the market, but it can be. We will consider providing this feature in a future version.
    2. Thank you for the note about the CurrentRowChanged event. The issue was addressed immediately, and the fixed version will appear in the Q2 SP1 release in two weeks.
    3. As to the hierarchical mode, adding a new row in the detail table is possible. We are still adding and improving the API for it and this task will be easier with each new version of RadGridView.
    Again, sorry for the inconvenience caused by not providing enough details with our answers.

     
    Regards,
    Julian Benkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for WinForms is Visual Studio 2017 Ready