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

Position item in the RadlistBox use "FindItem"

1 Answer 137 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Alain Cabot
Top achievements
Rank 1
Alain Cabot asked on 08 Nov 2010, 04:40 PM
Hello
I have a screen with a RadListBox where users are able to search through the list with a button and a search button below. The user enters the search value and fact find.
I am able to find the right items with my search button and using the following method "FindItem" of control.

My problem is that if I have a scrollbar because I have a lot of information in the list find the item is in the bottom of the list, the control does not set the list to see who is selected by programming .

If it is not clear, I have an example I can send you.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Nov 2010, 08:02 AM
Hello Alain,


Invoke the scrollIntoView() method of RadListBoxItem in order to put the item at the bottom of the visible area.

Sample code:
function searchItem() {
 
    var listBox = $find('<%= RadListBox2.ClientID  %>');
    var item = listBox.findItemByText("Mango"); // get the item
    item.scrollIntoView();
 
}



-Shinu.
Tags
ListBox
Asked by
Alain Cabot
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or