Hi All,
I am creating a listbox with itemsource of type dataview. I want to scroll the listbox to praticular item which is not selected. I am using the following code for selected item.
Code:
Binding listbox:
DataView dv = newDt.DefaultView;
dv.Sort = "Count Desc";
lbResult.DataContext = dv;
To get the row based on id:
var selectResult = from mypro in albumDetails.ToTable().AsEnumerable() where mypro.Field<string>("ID")==search.ID select mypro;
if (lbResult.SelectedItem != null)
{
lbResult.ScrollIntoView(**lbResult.Items[0]**);
}
How to get the index if the row in the list box.
Geetha