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

    IMAGE : IMAGE
  2. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 01 Mar 2013 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top