4 Answers, 1 is accepted
0
Hi,
I've just tried this however everything worked fine - you can check the attached project for more info.
Kind regards,
Vlad
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.
I've just tried this however everything worked fine - you can check the attached project for more info.
Kind regards,
Vlad
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

sum sum
Top achievements
Rank 1
answered on 06 Nov 2009, 03:00 PM
Hi,
There are two issues here.
1. In your sample, it is working. However, in my application although the grid.ItemSource has something but grid.items.count is always = 0 until the UI is rendered. Then the next time grid.Items.count has something and I can ScrollIntoView. I am not sure if it is a bug. Once you specify the ItemSource, does the items.count has a value right away?
2. When items.count !=0, when doing ScrollIntoVIew, the error I got is:
"Object reference not set to an instance of an object."
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.InsertContainer(Int32 childIndex, UIElement container, Boolean isRecycled)\r\n at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.InsertNewContainer(Int32 childIndex, UIElement container)\r\n at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.AddContainerFromGenerator(Int32 childIndex, UIElement child, Boolean newlyRealized)\r\n at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.BringIndexIntoView(Int32 index)\r\n at Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollRowIntoView(Object item)\r\n at Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollIntoView(Object item)\r\n
There are two issues here.
1. In your sample, it is working. However, in my application although the grid.ItemSource has something but grid.items.count is always = 0 until the UI is rendered. Then the next time grid.Items.count has something and I can ScrollIntoView. I am not sure if it is a bug. Once you specify the ItemSource, does the items.count has a value right away?
2. When items.count !=0, when doing ScrollIntoVIew, the error I got is:
"Object reference not set to an instance of an object."
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.InsertContainer(Int32 childIndex, UIElement container, Boolean isRecycled)\r\n at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.InsertNewContainer(Int32 childIndex, UIElement container)\r\n at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.AddContainerFromGenerator(Int32 childIndex, UIElement child, Boolean newlyRealized)\r\n at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.BringIndexIntoView(Int32 index)\r\n at Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollRowIntoView(Object item)\r\n at Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollIntoView(Object item)\r\n
0

sum sum
Top achievements
Rank 1
answered on 06 Nov 2009, 04:00 PM
In your sample, the data is pre-populated and then you scrollintoview.
But in my application:
let's say I have 10 records in the collection which is binding to the grid. I added one more record to the collection. grid.items.count turns to 11. SelectedItem goes to the newly added one. Then I tried to scrollIntoView this newly added record. It gave me the above error message. It seems although the grid recognize the newly added record, the ScrollIntoView does not know this item.
But in my application:
let's say I have 10 records in the collection which is binding to the grid. I added one more record to the collection. grid.items.count turns to 11. SelectedItem goes to the newly added one. Then I tried to scrollIntoView this newly added record. It gave me the above error message. It seems although the grid recognize the newly added record, the ScrollIntoView does not know this item.
0
Hi sum sum,
Kind regards,
Milan
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.
Please refer to this thread for more information.
Kind regards,
Milan
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.