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

ListView

1 Answer 94 Views
ListView
This is a migrated thread and some comments may be shown as answers.
neil
Top achievements
Rank 1
neil asked on 30 Jan 2020, 10:53 AM

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

 

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 31 Jan 2020, 12:36 PM

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.
Tags
ListView
Asked by
neil
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or