This is a migrated thread and some comments may be shown as answers.

How to edit subitems via code?

2 Answers 479 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 21 May 2012, 03:40 PM
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 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 23 May 2012, 05:35 PM
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 >>
0
jasmeet
Top achievements
Rank 1
answered on 28 Jul 2015, 04:23 AM

Hi Peter,

you can do like this

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

this will work for you.

Thanks

Jasmeet

Tags
ListView
Asked by
Peter
Top achievements
Rank 1
Answers by
Stefan
Telerik team
jasmeet
Top achievements
Rank 1
Share this question
or