1

and also cannot add subitems to a ListView control in .net, for example in c# i have this code:

this.listView1.Items.Add(A.Key);
this.listView1.Items[i].SubItems.Add(Convert.ToString(A.Value));
this.listView1.Items[i].SubItems.Add(Convert.ToString(A1[A.Key]))

How to "convert" or use same feature in asp.net page, with idea of adding items and subitems too in a list view control.

Eilon
  • 25,582
  • 3
  • 84
  • 102
gaponte69
  • 1,337
  • 3
  • 14
  • 21

1 Answers1

1

When you are adding, you need to either add a listviewitem object or you need to add with value and index.

The sample code in the Microsoft Documentation should help:

https://learn.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.listview.items?view=netframework-4.8

TylerH
  • 20,799
  • 66
  • 75
  • 101
Brian P
  • 1,569
  • 13
  • 23
  • could you please send an example for a ListView1 Control in .net code, but according to above request, considering the control is added to the page a need to get items/subtitems as per equest above i repeat...Thank you! – gaponte69 Feb 04 '13 at 22:20