I am trying to select the first item of the ultralistview through code behind. I don't see a select method off of items collection. I tried using <listviewbox>.Items[0].CheckedState and <listviewbox>.Items[0].Activate(), but they do not select the item. I appreciate any help in this regard.
See UltraListView.SelectedItems
Thanks Brian. Isn't UltraListView.SelectedItems is for accessing the already selected items? All I want to do is to pre-select the first list item through the code when the form is initially loaded. It should be as simple as <listView>.Items[0].Select(), but UltraListView doesn't have a Select method off of items collection.
This code selects one item, the question was how to select all items. Note that since this question was originally posted, the PerformAction method was updated to provide support for selecting all items (as is the case when the Ctrol+A keystroke is processed). Call the method passing UltraListViewAction.SelectAllItems as the value of the actionCode parameter.
UltraListView1.SelectedItems.Add(UltraListView1.Items[index]);
regards,
Ceaser
No, there is no SelectAll method.
Is there not a SelectAll method or do I have to loop through each item and add it to the SelectedItems property?
Thank you very much. The add method off of the selecteditems collection did the trick.