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

Row Details

8 Answers 127 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Renier Oosthuizen
Top achievements
Rank 1
Renier Oosthuizen asked on 25 Feb 2011, 08:40 PM
Hi!

We have a grid several hierarchies deep and the moment a rowdetail(and thus grid) scrolls out of view, UnloadingRowDetails fires and the details template gets disposed causing the child grid and it's data to dispose.

Is there a way to stop the UnloadingRowDetails event from firing and just leaving the row expanded?

Regards
Renier

8 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 28 Feb 2011, 03:32 PM
Hi Renier Oosthuizen,


The only way to disable the unloading of RowDetails is to turn off the row virtualization feature by setting EnableRowVirtualization to false. Will that be okay for your scenario?

 

Kind regards,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
invDev
Top achievements
Rank 1
answered on 28 Feb 2011, 03:48 PM
Hey,

I have the same issue and was very pleased to see this thread. Turning off the RowVirtualization works fine, but ends up with a very poor performance. Is there another possibility, perhaps interrupting the UnloadRowDetails event?

Thanks, Jonas
0
Maya
Telerik team
answered on 28 Feb 2011, 04:44 PM
Hello Jonas,

Generally, once a row is recycled, its RowDetails will be too. What you may try to do is to use a hierarchy template instead as the child elements in this case would be cached. 

Kind regards,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
invDev
Top achievements
Rank 1
answered on 14 Mar 2011, 12:45 PM
Hello,

I'm just trying to use the HierarchyChildTemplate instead the RowDetails. Inside the DataTemplate is a custom UserControl which I filled in a LoadingRowDetails event handler, when i used the RowDetails.

I did not find a similar handler for the HierarchyTemplate. Furthermore I call the ExpandAllHierarchyItems() and CollapseAllHierarchyItems() to initalize the views.

I'm not sure, if this is the best attempt to put data into the HierarchyChild. What would be the best practice in this case?

Thank you in advance,

Jonas
0
Maya
Telerik team
answered on 14 Mar 2011, 01:23 PM
Hi,

Basically, the grid loads the data for the child grids on demand. However, you may take a look at this blog post and this forum thread for additional reference.
As far as the corresponding events are concerned, on opening the parent row the RowIsExpandedChanging and RowIsExpandedChanged events will be fired.
  

Greetings,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
invDev
Top achievements
Rank 1
answered on 14 Mar 2011, 02:15 PM
The child of each GridRow is not another DataGrid, but a DataTemplate with a CustomControl. Therefore the HierarchyChildTemplate looks like this:

<DataTemplate x:Key="DetailGridRow">
    <PVUIControls:myUserControl></PVUIControls:myUserControl>
</DataTemplate>

When using the RowDetails i got the myUserControl object in the LoadingRowDetails handler from GridViewRowDetailsEventArgs.DetailsElement.

Now, the RowIsExpandedChanged handler is triggered right, but i can't find HierarchyChild for each row in the event args. Is there any possibilty to get myUserControl from this handler method?
0
Maya
Telerik team
answered on 17 Mar 2011, 01:35 PM
Hello Jonas,

Generally, the element in the hierarchy child template will not be initialized until being expanded. May you provide a bit more details about the scenario you want to accomplish ? 
 

All the best,
Maya
the Telerik team
0
invDev
Top achievements
Rank 1
answered on 17 Mar 2011, 05:41 PM
I solved our problem by using the RowDetails and providing all data to the control to rebuild it completey.

Thank you!
Tags
GridView
Asked by
Renier Oosthuizen
Top achievements
Rank 1
Answers by
Maya
Telerik team
invDev
Top achievements
Rank 1
Share this question
or