ListView

2 posts, 0 answers
  1. neil
    neil avatar
    9 posts
    Member since:
    Nov 2016

    Posted 30 Jan 2020 Link to this post

    Hi

    I am trying to save a row item to a internel variable without much succes.

     

    lstTags is a detailed veiw and it curretly works.

     

    I basicaly want to get reocrd 6 save to listViewDataItem

    then look to see what the sub items are set too?

     

    The code i have is;

    Dim listViewItem As ListViewDataItem = lstTags.Items(6)  

    Dim itemId As String = listViewItem.SubItems(1).Text 

     

    There are no sub-items.

     

     

    Neil

     

  2. Nadya
    Admin
    Nadya avatar
    502 posts

    Posted 31 Jan 2020 Link to this post

    Hello Neil,

    According to the provided information, it seems that you have RadListView in DetailsView. In this view, RadListView provides a grid-like interface and displays columns. In order to get values from cells, you should access the column values for an item by using the their indexers. They can be either the index of the column, the name of the column, or the column reference itself. You might find the following help article useful on this topic: https://docs.telerik.com/devtools/winforms/controls/listview/populating-with-data/unbound-mode#adding-columns.

    Here is an example of how to get sub items by using columns indexes:

    Dim subItem1 = Me.radListView1.Items(5)(0)
    Dim subItem2 = Me.radListView1.Items(5)(1)

    Note, that the SubItems collection is intended for adding items at design time and it is not recommended to be used in runtime.

    I hope this helps. Should you have any other questions, I will be glad to help.

    Regards,
    Nadya
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top