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

Problem Implementing Master / Child RadGrids

2 Answers 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
ToltingColtAcres asked on 10 Apr 2011, 03:11 PM
Hello, I am attempting to implement a series of Master / Child RadGrids, similar to the example located:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectedvalue/defaultcs.aspx


In fact, I copied most of this code and modified it to work with my database structure.

The problem I have is as follows:

When clicking on a row in Grid #1 to select it, the child Grids #2 and #3 update correctly to reflect the appropriate data associated with Grids #1 and #2, respectively

However, when I use the Next/Previous buttons located in Grid #1 to move between records, only the data in Grid #2 updates. The data in Grid#3 never updates.

The online example posted above exhibits the same behavior. At first I thought that I did something wrong in my program, and have been wracking my brains for a day trying to figure out what I did wrong. Only after I went back to the online example did I see the online example exhibits the same behavior. You can see for yourself... if you go to the example, and click on one of the rows in Grid #1, the data in Grids #2/3 will update... but if you click on the nav buttons in Grid #1, only Grid #2 updates, Grid#3 remains unchanged.

Two questions:

a. Is this a bug in the control, and

b. How can I get Child Grid #3 to update correctly from Grid #2's key value when the user clicks a navigation button on Master Grid #1?

2 Answers, 1 is accepted

Sort by
0
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
answered on 12 Apr 2011, 03:14 PM
bump. anyone? been messing w/ this now for a few days, have a project @ a standstill as I can't get this to function.
0
Daniel
Telerik team
answered on 18 Apr 2011, 09:24 AM
Hello Michael,

Sorry for the late reply.

Onto your questions:

a) No. This is an expected behavior which is related to the implementation of this demo.

b) Please modify the code this way:
protected void Page_PreRender(object sender, EventArgs e)
{
    if (RadGrid1.SelectedIndexes.Count == 0)
        RadGrid1.SelectedIndexes.Add(0);
    if (RadGrid2.SelectedIndexes.Count == 0)
    {
        RadGrid2.Rebind();
        RadGrid2.SelectedIndexes.Add(0);
    }
}
 
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
    RadGrid2.SelectedIndexes.Clear();
}

I hope this helps.

Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
Answers by
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
Daniel
Telerik team
Share this question
or