How To ListviewSubItem Add?

2 posts, 1 answers
  1. ASD
    ASD avatar
    3 posts
    Member since:
    Feb 2013

    Posted 27 Feb 2013 Link to this post

    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);

  2. Answer
    Stefan avatar
    2911 posts

    Posted 01 Mar 2013 Link to this post


    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:

    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");

    I hope this helps.

    All the best,
    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.
Back to Top