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

ScrollIntoView bug

3 Answers 144 Views
GridView
This is a migrated thread and some comments may be shown as answers.
sum sum
Top achievements
Rank 1
sum sum asked on 10 Nov 2009, 12:42 AM
Hi,

I don't get an answer for this issue. So, I have to re-post it again. Hope someone can help me out here.

The sample Telerik gave is not the same case as my application. The sample is quite simple. Load 100 rows, select a row and then scrollIntoView.

My case is:

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 below error message. It seems although the grid recognize the newly added record, the ScrollIntoView does not know this item. 

"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  

3 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 10 Nov 2009, 08:00 AM

Hello sum sum,

We have managed to reproduce the problem and we are currently working on a solution.  It seems that the problem only occurs if the Rebind method is called and I am wondering if you are making a call to the Rebind method after you add a new record?

Fortunately there is a workaround which could spare you some time waiting for our fix. If you use an ObservableCollection as ItemsSource you shouldn't call Rebind (if you are calling it) and the ScrollIntoView method should work as expected.

Hope this helps.


All the best,
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.
0
sum sum
Top achievements
Rank 1
answered on 10 Nov 2009, 03:00 PM
Hi,

Thanks for the reply. I do use ObservableCollection and I am not calling Rebind function. I still get the same error when calling ScrollIntoView. I am using Q3 Release.

Thank you,
0
Milan
Telerik team
answered on 11 Nov 2009, 03:02 PM

Hi sum sum,

I think we have managed to fix the issue. Still, your scenario could be a bit different. May I ask you to try our latest build and determine if the issue is indeed resolved? Since this is a forum thread I am sending you Trial assemblies. 

The official Internal Build with that fix will be available this Friday.
Hope this helps.

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.
Tags
GridView
Asked by
sum sum
Top achievements
Rank 1
Answers by
Milan
Telerik team
sum sum
Top achievements
Rank 1
Share this question
or