This is a migrated thread and some comments may be shown as answers.

Gridview refresh problem

5 Answers 345 Views
GridView
This is a migrated thread and some comments may be shown as answers.
liviu
Top achievements
Rank 1
liviu asked on 09 Aug 2007, 01:02 PM

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.

5 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 10 Aug 2007, 02:08 PM
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
0
liviu
Top achievements
Rank 1
answered on 27 Sep 2007, 10:48 AM

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
0
Julian Benkov
Telerik team
answered on 27 Sep 2007, 01:16 PM
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
0
liviu
Top achievements
Rank 1
answered on 28 Sep 2007, 10:12 AM
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
0
Julian Benkov
Telerik team
answered on 28 Sep 2007, 02:50 PM
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
Tags
GridView
Asked by
liviu
Top achievements
Rank 1
Answers by
Dwight
Telerik team
liviu
Top achievements
Rank 1
Julian Benkov
Telerik team
Share this question
or