This is the xaml of listview
<ListView Grid.Column="1" Height="auto" Name="ListView1" Width="auto" AllowDrop ="True" >
<ListView.View>
<GridView >
<GridViewColumn Header="File Name" />
<GridViewColumn Header="Path" />
<GridViewColumn Header="type" />
</GridView>
</ListView.View>
</ListView>
I add a item into the listbox, but it add a row with three same value
ListView1.Items.Add("abcd")
I have also tried some ways, but still have problem
So I would like to know how I can add different value to second column
Dim x As ItemCollection
x.Add("a")
x.Add("b")
x.Add("c")
ListView1.Items.Add(x)
Dim x As New ItemCollection
x.Add("a")
x.Add("b")
x.Add("c")
ListView1.Items.Add(x)
And How to get the value at second column?
I have tried this code, but it just return the second character of first column, I can’t find any ways to access the second column
ListView1.Items(0)(1)
I think you need to bind the list for this to work.
I made this sample class:
Changed the xaml to include DisplayMember bindings:
And loaded some sample data:
Good luck!!