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

Added Child row not visible

1 Answer 14 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Richard Harrigan
Top achievements
Rank 1
Richard Harrigan asked on 22 Mar 2011, 03:42 AM

Hi,

The following is a code snippet that add's a child item ("Model") to a parent item ("Car"). If the "Model" rows are collapsed the new "Model" item is visible when the "Car" parent is expanded.  If however the "Car" was already expanded the "Model" row is not visible.  If I then collapse and expand it still does not show.  Is there a property that I can set to make the "Model" row visible?

Thanks
Rich

 

void RadGridView1_SelectionChanged(object sender, SelectionChangeEventArgs e)
        {
            GridViewDataControl gridDC = e.Source as GridViewDataControl;
  
            if (gridDC.SelectedItem is Car)
            {
                Car car = ((Car)gridDC.SelectedItem);
  
                Model model = new Model();
                model.ModelName = "Matrix";
                model.Horsepower = 166;
                model.Wheelbase = 112;
                car.Models.Add(model); 
            }
        }

 

 

1 Answer, 1 is accepted

Sort by
0
Richard Harrigan
Top achievements
Rank 1
answered on 22 Mar 2011, 04:57 AM
Hi

I added the following and it worked.  Are there any problems doing this...performance etc.

Thanks
RIch

RadGridView1.ItemsSource =

 

DataManager.Cars;

 

 

RadGridView1.Rebind();

Tags
GridView
Asked by
Richard Harrigan
Top achievements
Rank 1
Answers by
Richard Harrigan
Top achievements
Rank 1
Share this question
or