How to edit subitems via code?

3 posts, 0 answers
  1. Peter
    Peter avatar
    1 posts
    Member since:
    May 2012

    Posted 21 May 2012 Link to this post

    Hi,

    How can i edit subitems via code?

    I tried something like:

    RadListView1.SelectedItem.SubItems(3).Text = "Test"

    Like it works on a normal Listview, but RadListView doesn't have the parameter 'Text'.
    So how can i change the text of the subitem from the selected item ?

    Thanks,
    Peter
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 23 May 2012 Link to this post

    Hello Peter,

    Thank you for writing.

    There are couple of overloads that allow you to assign/modify the column values for an item:
    - by using the column index
    - by using the column name
    - by using a column reference

    All three are demonstrates in the "Populating cells" section of this help article: http://www.telerik.com/help/winforms/listview-programatically-populating-with-data.html 

    I hope this helps.

    Greetings,
    Stefan
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. jasmeet
    jasmeet avatar
    1 posts
    Member since:
    Jul 2015

    Posted 27 Jul 2015 in reply to Peter Link to this post

    Hi Peter,

    you can do like this

    RadListView1.SelectedItems[0].SubItems[3].ToString()="Test"

    this will work for you.

    Thanks

    Jasmeet

Back to Top