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

Hiding child heirarchy when needed.

10 Answers 141 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 20 May 2009, 06:00 PM
Hello all,
    I have a RadGridView with a HierarchyChildTemplate of another RadGridView.  This RadGridView also has a HierarchyChildTemplate of a RadGridView and so on one more time.  Once the page loads, I am creating the 3 child GridViewTableDefinitions accordingly and adding field descriptors and TableRelations as needed. 
    The grid renders ok and the data is related properly, but the problem I am running into is that if a row in the grid does not have any child data, I am able to click on the plus sign to the left of the row and expand out to see an empty grid.  (all I see is the column headers in the child).  The behavior I want is, if the row does not have any child records, for the plus sign to go away (or be disabled, either is fine) and not allow the user to expand the row.

Suggestions?

Thanks,
Greg

10 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 21 May 2009, 05:39 AM
Hello Greg,

You can add the definition and set if the row can be expanded in our PreviewDataRecordCreate event. Please check this demo for more info:
http://demos.telerik.com/silverlight/#GridView/Hierarchy/CustomRelationalHierarchy

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Greg
Top achievements
Rank 1
answered on 01 Jun 2009, 01:18 PM
Thanks for the help!  I followed the example and got my child tables showing up as expected except for one little hiccup.  In one data set the the parent grid has a total 26 rows.  Only the first row has any children associated with it so it is the only row with a "plus" sign next to it. (Which is great).  However, after I get past row twenty, the grid seems to "forget" to leave room for the possiblity of having a plus sign in the far left side of the grid, so rows 20-26 are several pixels to the left of the other rows.  This only seems to occur when i set the height of the grid.  To get around this issue for the moment, I am not setting the height of the grid and placed a scrollviewer around it so I could scroll.  Obviously, I can't ship this is this manner because scrolling causes the column headers to go away.

This seems like a bug in the RadGrid.  Let me know your thoughts.
0
Kalin Milanov
Telerik team
answered on 02 Jun 2009, 08:55 AM
Hi Greg Case,

This behavior occurs due to row virtualization. What happens is that when you scroll down the row which has hierarchy disappears together with the Expand/Collapse button which is responsible for the row indentation. When this happens the subsequent rows get created unaware of that they need to be indented. This is a bug which we logged and will try to eliminate for Q2.

Until then you can review this example and place your own scroll viewer. You will just need to make sure the grid does not show its own scroll bar.

I hope this will do get the job done until the fix arrives.

All the best,
Kalin Milanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Greg
Top achievements
Rank 1
answered on 02 Jun 2009, 01:08 PM
Suggestions on how to make the grid's scroll bar dissappear?  Doing the following gives me a parsar error:

ScrollViewer.VerticalScrollBarVisibility

 

="Hidden"

 

0
Greg
Top achievements
Rank 1
answered on 02 Jun 2009, 01:25 PM
Can you tell me an approximate date of the Q2 release?  The workaround on the example doesn't seem to be all that useful.  Looks like we are basically rebinding to a new datasource everytime the user attempts to scroll.

Do you have any other suggestions?
0
Hristo
Telerik team
answered on 04 Jun 2009, 10:41 AM
Hello Greg Case,

Right now it is not so easy as it should be to disable/hide scrollbars.
We are using custom scroll viewer so setting ScrollViewer.VerticalScrollBarVisibility won't work.
The only work around that i can think of at the moment is to attach handler to RadGridView.RowLoaded event and then you can use the following method to disable horizontal scrolling:

// you will need to add using Telerik.Windows.Controls namespace;  
 
private void RadGridView_RowLoaded(object sender, RowLoadedEventArgs e)  
{  
    radGridView1.RowLoaded -= RadGridView_RowLoaded;  
    radGridView1.ItemsControl.VirtualizingPanel.ParentOfType<GridViewScrollViewer>().CanHorizontallyScroll = false;  

We will improve this with one of the next releases.
As for the Q2 release it will be at the beginning of June.

Regards,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
James
Top achievements
Rank 1
answered on 01 Oct 2009, 07:52 AM

Hi Hristo,

 

I'm having similar issues displaying nested HierarchyChildTemplate controls and scrolling vertically.

I understand this is due to virtualization, which makes sense. Is it possible to disable this feature? I could easily live without this performance enhancement in exchange for being able to scroll vertically without this bug.

I've attached a sample project demonstrating the bug (incase you think it's been fixed). All you need to do to reproduce is expand a few nodes and start scrolling down, then back up again.. You'll soon see the problems that occurs.

I will use my own scrollviewer in the mean time.

Cheers,
James.

 

0
James
Top achievements
Rank 1
answered on 01 Oct 2009, 07:53 AM
here's a link to the project file, for some reason the upload failed...

http://cid-47007997392d2bb4.skydrive.live.com/self.aspx/.Public/RadGridView.zip?lc=5129
0
Hristo
Telerik team
answered on 01 Oct 2009, 01:06 PM
Hello James,

Unfortunately this is not possible with Q2 release. In the middle of october we will release beta version of RadControls for Silverlight 3 containing a lot of improvements some of which are ability to stop virtualization, change recycling mode to standard, improved loading time, improved scrolling speed etc.
I hope this timeframe is acceptable for you.

Best wishes,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
James
Top achievements
Rank 1
answered on 01 Oct 2009, 07:39 PM
Ok that sounds great, thanks for the reply.
Cheers,
James.
Tags
GridView
Asked by
Greg
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Greg
Top achievements
Rank 1
Kalin Milanov
Telerik team
Hristo
Telerik team
James
Top achievements
Rank 1
Share this question
or