Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6626179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:51:46+00:00 2026-05-25T21:51:46+00:00

This is the xaml of listview <ListView Grid.Column=1 Height=auto Name=ListView1 Width=auto AllowDrop =True >

  • 0

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)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:51:46+00:00Added an answer on May 25, 2026 at 9:51 pm

    I think you need to bind the list for this to work.

    I made this sample class:

    Public Class ListViewItemTemplate
        Public Property FileName As String
        Public Property FilePath As String
        Public Property FileType As String
    End Class
    

    Changed the xaml to include DisplayMember bindings:

        <ListView Name="ListView1" Width="auto" AllowDrop ="True" Margin="0,0,0,41">
            <ListView.View>
                <GridView >
                    <GridViewColumn Header="File Name" DisplayMemberBinding="{Binding Path=FileName}" />
                    <GridViewColumn Header="Path" DisplayMemberBinding="{Binding Path=FilePath}"/>
                    <GridViewColumn Header="type" DisplayMemberBinding="{Binding Path=FileType}" />
                </GridView>
            </ListView.View>
        </ListView>
    

    And loaded some sample data:

        Dim itemsList As New List(Of ListViewItemTemplate)
        Dim item As New ListViewItemTemplate
        item.FileName = "FileName A"
        item.FilePath = "FilePath A"
        item.FileType = "FileType A"
        itemsList.Add(item)
        item = New ListViewItemTemplate
        item.FileName = "FileName B"
        item.FilePath = "FilePath B"
        item.FileType = "FileType B"
        itemsList.Add(item)
        item = New ListViewItemTemplate
        item.FileName = "FileName C"
        item.FilePath = "FilePath C"
        item.FileType = "FileType C"
        itemsList.Add(item)
        ListView1.ItemsSource = itemsList
    

    Good luck!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.