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

How To ListviewSubItem Add?

1 Answer 489 Views
ListView
This is a migrated thread and some comments may be shown as answers.
ASD
Top achievements
Rank 1
ASD asked on 27 Feb 2013, 08:18 AM
ListViewItem add = new ListViewItem(oku["sembol"].ToString());
                add.SubItems.Add(oku["alis"].ToString()); add.SubItems.Add(oku["satis"].ToString());
                add.SubItems.Add(oku["yuksek"].ToString()); add.SubItems.Add(oku["dusuk"].ToString());
                add.SubItems.Add(oku["zaman"].ToString()); radlw_.Items.Add(add);

IMAGE : IMAGE

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 01 Mar 2013, 02:50 PM
Hello,

Thank you for writing.

When adding items to RadListView in DetailsView, it is important that you first add the item to the Items collection of the control, and only then set its cells values: http://www.telerik.com/help/winforms/listview-programatically-populating-with-data.html.

Alternatively, you can use the SubItems collection as well. It is a collection that is used to store design-time serialized data but can be used to hold initial values as well:
ListViewDataItem add = new ListViewDataItem();
add.SubItems.Add("first col value");
add.SubItems.Add("second col value");
add.SubItems.Add("third col value");
radListView1.Items.Add(add);

I hope this helps.


All the best,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Join us for a FREE webinar to see all the new stuff in action.

Interested, but can’t attend? Register anyway and we’ll send you the recording.
Tags
ListView
Asked by
ASD
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or