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

  • SEARCH
  • Home
  • 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 8931233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:04:20+00:00 2026-06-15T09:04:20+00:00

I am creating a ListView Grouped by ServiceName , but I am not able

  • 0

I am creating a ListView Grouped by ServiceName, but I am not able to display the FileName and FilePath, here are the classes and the Xaml:

public class SOService
{
    string _ServiceName;
    List<SOFileInfo> _SOFiles;

    public string ServiceName
    {
        get { return _ServiceName; }
        set { _ServiceName = value; }
    }
    public List<SOFileInfo> SOFiles
    {
        get { return _SOFiles; }
        set { _SOFiles = value; }
    }
}

public class SOFileInfo
{
    string _FileName;
    string _FilePath;

    public string FileName
    {
        get
        { return _FileName; }
        set { _FileName = value; }
    }
    public string FilePath
    {
        get { return _FilePath; }
        set { _FilePath = value; }
    }
}

the ViewModel:

public class SOServiceViewModel
{
    public SOServiceViewModel()
    {
        _Services = new List<SOService>();

        _Services.Add(new SOService()
        {
            ServiceName = "service1",
            SOFiles = new List<SOFileInfo>() { new SOFileInfo() { FileName = "File1", FilePath = "c:" } }
        });
    }
    List<SOService> _Services;

    public List<SOService> Services
    {
        get { return _Services; }
        set { _Services = value; }
    }
}

and the Xaml:
enter image description here

  • 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-06-15T09:04:21+00:00Added an answer on June 15, 2026 at 9:04 am

    Here is the solution I found:

    Add properties to retrieve the list of FileNames and FilePaths:

        public List<string> FileNames
        {
            get { return _SOFiles.Select(p => p.FileName).ToList(); }
            private set { }
        }
        public List<string> Filepaths
        {
            get { return _SOFiles.Select(p => p.FilePath).ToList(); }
            private set { }
        }
    

    then in the Xaml File:

    <GridViewColumn Header="File Name" Width="100">
                    <GridViewColumn.CellTemplate>
                        <DataTemplate DataType="{x:Type local:SOFileInfo}">
                            <ItemsControl ItemsSource="{Binding FileNames}" ></ItemsControl>
                        </DataTemplate>
                    </GridViewColumn.CellTemplate>
                </GridViewColumn>
                <GridViewColumn Header="File Path" Width="100">
                    <GridViewColumn.CellTemplate>
                        <DataTemplate DataType="{x:Type local:SOFileInfo}">
                            <ItemsControl ItemsSource="{Binding Filepaths}" ></ItemsControl>
                        </DataTemplate>
                    </GridViewColumn.CellTemplate>
                </GridViewColumn>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am creating a listview with custom arrayadapter..but the problem is in tablet it's
I am creating a custom listview. The data is not coming from a cursor
I seem to be having problem creating an adapter for listview to display items(Stuff
I am creating listview dyanamicaly in the code..Not through XML....!! Two things i couldnt
Here I am Creating ListView which shows songlist. And on list item click i
After creating a listview from VS2010 and adding it as a web part to
I'm creating a ListView that contains two TextViews and an ImageView. I'm passing data
I am creating a simple RSS reader which displays headlines in ListView, downloading it
Is there any way creating a photo gallery using Listview control ? Im playing
When creating a website using Asp.Net and using controls such as the ListView is

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.