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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:37:35+00:00 2026-05-20T04:37:35+00:00

In WPF I have a ListView that is bound to a table in a

  • 0

In WPF I have a ListView that is bound to a table in a Dataset. If I use (Commented out in full code view:

<ListView.View>
  <GridView>
  <GridViewColumn>

I get the rows displayed and I can see multiple rows and scroll through the rest.

If I try

<ListView.ItemTemplate>
  <DataTemplate>
     <Grid>
         <Grid.ColumnDefinitions>
           'Put a bunch of controls here bound to various columns in my data table

I can only see one row/record at one time. Am I missing a setting on one of the controls or is the ListView.ItemTemplate only going to show one record at a time.

I’m looking for something in WPF that is more like a Repeater control where I can have different controls for each record in a particular layout.

Full xaml:

<Window x:Class="GridTest"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="GridTest" Height="661" Width="750">

        <ListView Margin="4,1,8,1" 
                  Name="ListView_Transactions"  ItemsSource="{Binding}">
            <!--<ListView.View>
                <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="Transactions">
                <GridViewColumn DisplayMemberBinding="{Binding Path=TransactionHeaderID}" />


            </GridView>

            </ListView.View>-->
            <ListView.ItemTemplate>
                    <DataTemplate>
                        <Grid MaxHeight="600">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="Key" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Label Content="{Binding Amount}" Height="25" Name="Label_Amount" VerticalAlignment="Top" Width="134" Margin="50,201,526,0" />
                            <Label Content="{Binding ActivityCategory}" Height="24" HorizontalAlignment="Left" Name="Label_ActivityCategory" VerticalAlignment="Top" Width="161" Margin="208,201,0,0" />
                            <TextBox Height="23" HorizontalAlignment="Left" Name="TextBox_Customer" VerticalAlignment="Top" Width="163" Margin="440,201,0,0" />
                            <Button Content="Breakout" Height="20" Name="Button_Breakout" Width="90" BorderThickness="0" ClickMode="Press" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="50,244,0,223">

                            </Button>
                            <Label Content="{Binding ShortDescription}" Height="27" HorizontalAlignment="Left" Name="Label_ShortDescription" VerticalAlignment="Top" Width="480" Margin="50,270,0,0" />
                            <TextBlock Height="65" HorizontalAlignment="Left" Name="TextBlock_LogDescription" Text="{Binding LongDescription}" VerticalAlignment="Top" Width="480" Margin="50,303,0,0" />

                        </Grid>
                    </DataTemplate>
                </ListView.ItemTemplate>

        </ListView>

</Window>

View of result, text does render normally, but smudged for security purposes

Cleaned Up My Mess:

<ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto">
        <ItemsControl Name="ItemsC" ItemsSource="{Binding}">         
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <StackPanel HorizontalAlignment="Left">
                         <DockPanel >
                             <Label Content="{Binding Amount}" Height="25" DockPanel.Dock="Left" Name="Label_Amount" Width="100" />
                                <Label Content="{Binding ActivityCategory}" DockPanel.Dock="Left" Height="24" Name="Label_ActivityCategory" Width="100"  />
                                <TextBox Height="25" DockPanel.Dock="Left"  Name="TextBox_Customer" Width="123"  />
                            </DockPanel>
                            <StackPanel HorizontalAlignment="Left">
                                <Button Content="Breakout"  Height="25" Name="Button_Breakout" Width="90" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                <Label Content="{Binding ShortDescription}" Name="Label_ShortDescription" Width="550" />
                                <TextBlock Height="200" Name="TextBlock_LogDescription" Text="{Binding LongDescription}" Width="550"  />
                        </StackPanel>
                    </StackPanel>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
</ScrollViewer>
  • 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-20T04:37:36+00:00Added an answer on May 20, 2026 at 4:37 am
    1. Maybe you do not need a ListView. ItemsControl in my opinion is direct equivalent for Repeater

    2. Your ItemTemplate is messed up completely – I believe it causes your problems. Instead of putting everything into one Grid you should use several (probably nested) DockPanels/StackPanels. Remove all your fantastic margins – it should help. VS designer does his job badly creating a XAML, that’s why I prefer editing XAML on my own.

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

Sidebar

Related Questions

I have a WPf ListView that i am replacing the View with GridView to
I have a WPF ListView that is bound to a collection ( List<T> ).
In WPF, I have a ListView bound to an ObservableCollection in the code-behind. I
I have WPF ListView with GridView view and I want to remove any trace
I have a WPF application that has a ListView with a GridView in it.
I have a ListView in a WPF Application that use Dynamic Binding . I
I have a ListView in my WPF app that is bound to a collection
I have a WPF ListView that is bound to a BindingList<T>. The binding works
I have a ListView in WPF that is databound to a basic table that
In WPF I have a listview that is bound to an ObservableCollection. XAML: <ListView

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.