Programatically Select a DataBound item

4 posts, 0 answers
  1. Allen
    Allen avatar
    14 posts
    Member since:
    Aug 2012

    Posted 11 Sep 2012 Link to this post

    how do i do this? the "Current" only highlights the item but not really selecting it. is there another way?
  2. Ivan Todorov
    Ivan Todorov avatar
    688 posts

    Posted 14 Sep 2012 Link to this post

    Hi Rhea,

    Thank you for your question.

    To select an item programmatically, you can set the SelectedItem property of RadListView. Alternatively, you can use the Select(ListViewDataItem[] items) method:
    //to select a single item:
    this.radListView1.SelectedItem = this.radListView1.Items[0];
    //to select multiple items when multiselect is enabled:
    this.radListView1.Select(new ListViewDataItem[] { this.radListView1.Items[0], this.radListView1.Items[1] });

    I hope this will help you. Feel free to write back if you have any further questions.

    All the best,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. Oscar
    Oscar avatar
    3 posts
    Member since:
    Jun 2011

    Posted 21 Feb 2014 in reply to Ivan Todorov Link to this post

    Good Day, 

    I want to allow the item selection, but with only one click ( on click event, ) let the multiselection ( if I had CTRL key pressed ).
    Is there some property for use selection with one click and simulate CTRL press?

    Thanks a lot.
  4. Dimitar
    Dimitar avatar
    2983 posts

    Posted 26 Feb 2014 Link to this post

    Hi Oscar,

    Thank you for writing.

    Currently, this functionality is not supported in RadListView. However it can be achieved by using the ItemMouseDown and ItemMouseUp events. For example you can store the selected items in the ItemMouseDown and restore them in ItemMouseUp event handler:
    List<ListViewDataItem> selected = null;
    void radListView1_ItemMouseDown(object sender, ListViewItemMouseEventArgs e)
        selected = radListView1.SelectedItems.ToList();
        if (!selected.Contains(e.Item))
    void radListView1_ItemMouseUp(object sender, ListViewItemMouseEventArgs e)

    If you have any questions, please do not hesitate to contact us.

Back to Top