Hi Aniket,
Currently, the UI Virtualization feature is not supported in RadPanelBar, although it inherits from RadTreeView which supports it. If the RadTreeView fits in your scenario, your application will load much faster, cause only the items that are initially in the visual area will be generated, not all the items that are children of an expanded item.
On the other hand, usually when you want to use the BringIntoView method you have to specify the search property like so:
<telerik:RadPanelBar x:Name="radPanelBar"
BringIntoViewMode="HeaderAndItems"
telerik:TextSearch.TextPath="Title"
And then use GetItemByPath and BringIntoView in conjunction like so:
privatevoidTextBoxTextChanged(objectsender, TextChangedEventArgs e)
{
RadPanelBar parentBar = (((sender asTextBox).Parent asGrid) asUIElement).ParentOfType<RadPanelBar>();
RadPanelBarItem barContainer = parentBar.GetItemByPath("Item 1|"+ (sender asTextBox).Text, "|") asRadPanelBarItem;
if(barContainer != null)
{
barContainer.IsSelected = true;
barContainer.BringIntoView();
}
return;
}
Unfortunately, this won't work in your scenario, since the default PanelBar structure is changed (at least with the TextBox included).
As a workaround you can get the text typed in the textbox, parse it ( or parse a substring of it) and use it as a factor in the ScrollToVerticalOffset method of the ScrollViewer like so:
privatevoidTextBoxTextChanged(objectsender, TextChangedEventArgs e)
{
stringinput = (sender asTextBox).Text;
intresult;
var successfullParse = int.TryParse(input, outresult);
if(successfullParse)
{
(((sender asTextBox).Parent asGrid).Children[1] asScrollViewer).ScrollToVerticalOffset(result * 50);
}
return;
}
(Supposing the height of the PanelBaItem is 50). You can even use a mixture of the above two approaches ( first GetItemByPath to get the container and to make the selection and then scroll.
Greetings,
Petar Mladenov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and
book your seat for a walk through all the exciting stuff we ship with the new release!