6 Answers, 1 is accepted
0
Hello,
Using the ChildrenOfType<> extension method , you can find the GridViewScrollViewer. Somtehing like :
this.RadGridView1.ChildrenOfType<GridViewScrollViewer>();
All the best,
Pavel Pavlov
the Telerik team
Using the ChildrenOfType<> extension method , you can find the GridViewScrollViewer. Somtehing like :
this.RadGridView1.ChildrenOfType<GridViewScrollViewer>();
All the best,
Pavel Pavlov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0

Håkan
Top achievements
Rank 1
answered on 14 Dec 2012, 10:42 AM
Hi,
I have done that already, but I can't seem to find any suitable property on it.
I'm doing this when the collection in my view model changes.
Tried to check if ExtentHeight is larger than ViewportHeight but sometimes it it larget even thought the scrollbar is not visible.
That happens if you remove items until the scrollbar is hidden.
Regards,
Håkan
I have done that already, but I can't seem to find any suitable property on it.
I'm doing this when the collection in my view model changes.
Tried to check if ExtentHeight is larger than ViewportHeight but sometimes it it larget even thought the scrollbar is not visible.
That happens if you remove items until the scrollbar is hidden.
Regards,
Håkan
0
Hello,
The ScrollViewer has viewport height and extent height .If the extent is larger than the viewport - > a scroll bar appears.
Regards,
Pavel Pavlov
the Telerik team
The ScrollViewer has viewport height and extent height .If the extent is larger than the viewport - > a scroll bar appears.
Regards,
Pavel Pavlov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0

Håkan
Top achievements
Rank 1
answered on 17 Dec 2012, 07:15 AM
Hi Pavel.
I'm doing as you say, but it seems to be in the wrong place.
I do the check in the CollectionChanged event.
My grid fits 10 records so the scrollbar appears when adding the 11:th.
But at that point the ExtentHeight is 260 and the ViewportHeight is 261, so it seems the 11:th record is not added to the grid at this point.
If I remove the 11:th record, the ExtentHeight is 286, so that meend it's still in the grid at this point.
Is there a better place to do the check, when the grid is actually updated after the CollectionChanged event?
Regards,
Håkan
I'm doing as you say, but it seems to be in the wrong place.
I do the check in the CollectionChanged event.
My grid fits 10 records so the scrollbar appears when adding the 11:th.
But at that point the ExtentHeight is 260 and the ViewportHeight is 261, so it seems the 11:th record is not added to the grid at this point.
If I remove the 11:th record, the ExtentHeight is 286, so that meend it's still in the grid at this point.
Is there a better place to do the check, when the grid is actually updated after the CollectionChanged event?
Regards,
Håkan
0
Accepted
Hello,
You may try to perform the extent/viewport check in the LayoutUpdated event of RadGridView.
Kind regards,
Pavel Pavlov
the Telerik team
You may try to perform the extent/viewport check in the LayoutUpdated event of RadGridView.
Kind regards,
Pavel Pavlov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0

Håkan
Top achievements
Rank 1
answered on 18 Dec 2012, 07:09 AM
That worked fine, thank you!
- Håkan
- Håkan