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 6091009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:16:44+00:00 2026-05-23T12:16:44+00:00

I bound a ListView to a List(Of List(Of Integer)). I can specify the columns

  • 0

I bound a ListView to a List(Of List(Of Integer)).
I can specify the columns thus:

<ListView ItemsSource="{Binding ResultsByDenomination}">
<ListView.View>
    <GridView>
        <GridViewColumn Header="      "/>
        <GridViewColumn Header="Noord" DisplayMemberBinding="{Binding [0]}"/>
        <GridViewColumn Header="Oost" DisplayMemberBinding="{Binding [1]}"/>
        <GridViewColumn Header="Zuid" DisplayMemberBinding="{Binding [2]}"/>
        <GridViewColumn Header="West" DisplayMemberBinding="{Binding [3]}"/>
    </GridView>
</ListView.View>

This lays out the ListOfList neatly in a square grid.
However, I want to fill the first column with fixed values.
How do I do that, apart from rebuilding the ListOfListOf Integer to a ListOfList Of string and add the first column with fixed values there?

EDIT: Basically I want to add RowHeaders.

  • 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-23T12:16:44+00:00Added an answer on May 23, 2026 at 12:16 pm

    If you have one data structure for the row headers and another one for the row data, simply transform the data into a new data structure that is easily consumable by the ListView by combining them. Since you seem to like “nuts and bolts” data structures, you can use a List<Tuple<string, List<int>>> for this.

    Here is a simple example. First the code-behind to simulate your ResultsByDenomination property:

    void Window_Loaded(object sender, RoutedEventArgs e)
    {
        var rowHeaders = new List<string> { "One", "Two" };
        var rowData = new List<List<int>>
        {
            new List<int> { 1, 2, 3, 4 },
            new List<int> { 5, 6, 7, 8 },
        };
        var listViewData = rowHeaders.Zip(rowData, (a, b) => Tuple.Create(a, b)).ToList();
        DataContext = listViewData;
    }
    

    and the modified XAML to support the new data structure:

    <ListView ItemsSource="{Binding}">
        <ListView.View>
            <GridView>
                <GridViewColumn DisplayMemberBinding="{Binding Item1}"/>
                <GridViewColumn Header="Noord" DisplayMemberBinding="{Binding Item2[0]}"/>
                <GridViewColumn Header="Oost" DisplayMemberBinding="{Binding Item2[1]}"/>
                <GridViewColumn Header="Zuid" DisplayMemberBinding="{Binding Item2[2]}"/>
                <GridViewColumn Header="West" DisplayMemberBinding="{Binding Item2[3]}"/>
            </GridView>
        </ListView.View>
    </ListView>
    

    You can also create a utility class instead of using Tuple with more descriptive names.

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

Sidebar

Related Questions

I have a list in gridview. I have bound the gridview columns to get
In my View I got a ListView bound to a CollectionView in my ViewModel,
I have a ListView whose ItemsSource is bound to an ObservableCollection. The collection is
I have a ListView with a GridView that's bound to the properties of a
I have a ListView with a CheckBox as one of the columns, bound to
I have a list of objects bound to a ListView in Windows Phone 7
I have a WPF ListView that is bound to a collection ( List<T> ).
I have a ListView bound to a Generic List collection. I need to be
I have an ObservableCollection Bound to a WPF List View. I am looking to
In have a list of objects bound to a ListView that is used to

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.