Hi.
I have a listbox on a form. The user enters a value in a text box, clicks a button, the value is added to the list. All that works. The button click also sets the selected item to be the just entered value and calls scrolltoitem to reposition the listbox. The list box doesn't reposition.
Here is the code from the button click function:
private void radButton1_Click(object sender, EventArgs e)
{
var item = radTextBox1.Text;
if (string.IsNullOrWhiteSpace(item))
return;
// let's make sure this folder doesn't already exist in the list.
if (radListControl1.Items.Contains(item))
return;
var newItem = new RadListDataItem(item, item);
radListControl1.Items.Add(newItem);
radListControl1.SelectedItem = newItem;
radListControl1.ScrollToItem(newItem);
}
I have also attached a working example.
Why doesn't this work as expected?
Thanks
-marc