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

BringDataItemIntoView not working 2009 Q1

1 Answer 31 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 14 Oct 2009, 04:37 PM
I can't seem to get BringDataItemIntoView for 2009 Q1 release.

XAML

<

 

telerik:RadGridView Foreground="Black" MultipleSelect="True" Margin="0, 0, 0, 0" SelectionChanged="gvMainWorkQueue_SelectionChanged" CanUserReorderColumns="False" ShowGroupPanel="False" AutoGenerateColumns="False" Name="gvMainWorkQueue" Grid.Row="0" Grid.Column="0" AllowDrop="False" telerik:StyleManager.Theme="Telerik" />

 

 



Code

 

object currentRec = gvMainWorkQueue.SelectedItem;

 

gvMainWorkQueue.ItemsSource = GetDataSource();

 

gvMainWorkQueue.Rebind();

 

 

 

if (currentRec != null) {

 

gvMainWorkQueue.SelectedItem = currentRec;

gvMainWorkQueue.BringDataItemIntoView(gvMainWorkQueue.SelectedItem);

}

no errors occur.  The grid doesn't auto scroll to bring the item into view. 
Also not having any luck with 2009 Q2.

 

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 16 Oct 2009, 01:06 PM
Hi Brian,

We would like to apologize for this behavior. We are aware of this issue, but unfortunately there is no workaround possible at this time.

With our Q3 Release (early November) we will be introducing our brand new virtualization mechanism and the BringItemIntoView method will be replaced with the ScrollIntoView method, which should behave correctly.

On a side note, when you upgrade to the Q3 Release make sure that your business object class has the Equals method overridden so that after you rebind the grid the cached SelectedItem would be matched against an item from the new data source. In other words, since the data item references will be different (even though they point to the same logical data), the class will need an Equals method to compare the two references and decide that they are equal , i.e. for this line to work:

gvMainWorkQueue.SelectedItem = currentRec;

Please, excuse us for the inconvenience.

Regards,
Ross
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
Brian
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or