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

How can I dynamically add dataobject to childgrid

2 Answers 86 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Auvo
Top achievements
Rank 1
Auvo asked on 18 Jul 2011, 07:39 AM

I'm using the radGridView and it's hierarchy feature. Because of large amount of data, I fetch data first to the upper/first layer of radGridView with empty sub data object to provide +-mark of beginning of each row (identify that there are sub data available). I'm using the Radgridview.ItemsSource property to add data to the grid.

But now I have problem when expanding one of the row and dynamically add the dataobject to the selected childgrids.itemssource, it's not showing. I'm using following code to add data to the selected childgrid

 

private void alarmsTbl_DataLoading(object sender, Telerik.Windows.Controls.GridView.GridViewDataLoadingEventArgs e)
{
        GridViewDataControl dataControl = (GridViewDataControl)sender;
        if (dataControl.ParentRow != null)
        {
            AlarmsServiceReference.AlarmDetails[] groupDetails = alarmsClient.GetAlarmGroupDetails(alarmsTableDef.DBType, alarmsTableDef.ConnectionString, sql);
            dataControl.ItemsSource = groupDetails;
        }
}

 

 


How I can dynamically add dataobject to the expanded childgrid?


 

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 18 Jul 2011, 12:16 PM
Hi Auvo,

 May you please take a look at this forum thread? There is a sample project on how to load data related only for the row you have expanded with the "+".


All the best,
Didie
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Auvo
Top achievements
Rank 1
answered on 18 Jul 2011, 12:47 PM
Yep, now it's works!

Thank you!
- Auvo -
Tags
GridView
Asked by
Auvo
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Auvo
Top achievements
Rank 1
Share this question
or