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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:47:09+00:00 2026-05-22T17:47:09+00:00

For each record (Name, Age, City, E-mail) in the table . I need to

  • 0

For each record (Name, Age, City, E-mail) in the table.

I need to have one stack panel (see in image below stack-panel with sky blue color).

And add such list of stack panel in to dock panel (see image below dock-panel with Light Gray color).

How could it be implementing in WPF?

Does user control can help me?

Then how could I add usercontrols inside dockpanel as much records congaing in table?

Is there any other better and standard way?

i needs to going with MVVM, so giving your answer by considering this point…..

enter image description here
Thanks……

  • 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-22T17:47:10+00:00Added an answer on May 22, 2026 at 5:47 pm
    <Window x:Class="WpfApplication7.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300">
      <ScrollViewer>
    <ItemsControl ItemsSource="{Binding Persons}">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <UniformGrid IsItemsHost="True"
                             Columns="2" />
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <Border BorderBrush="Black" Margin="2" BorderThickness="2"
                        Background="LightBlue">
                    <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                    </Grid.ColumnDefinitions>
    
                    <TextBlock Grid.Row="0" Text="Name" Margin="5"></TextBlock>
                    <TextBlock Grid.Row="1" Text="Age" Margin="5"></TextBlock>
                    <TextBlock  Grid.Row="2" Text="City" Margin="5"></TextBlock>
                    <TextBlock Grid.Row="3" Text="Email" Margin="5"></TextBlock>
                        <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Name}" Margin="5"></TextBox>
                        <TextBox Grid.Row="1"
                                 Grid.Column="1"
                                 Text="{Binding Age}" Margin="5"></TextBox>
                        <TextBox Grid.Row="2"
                                 Grid.Column="1"
                                 Text="{Binding City}" Margin="5"></TextBox>
                        <TextBox Grid.Row="3"
                                 Grid.Column="1"
                                 Text="{Binding Email}" Margin="5"></TextBox>
                    </Grid>
                    </Border>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
    

    in the c# code

    public partial class Window1 : Window,INotifyPropertyChanged 
    {
        public Window1()
        {
            Persons = new ObservableCollection<Person>();
    
            InitializeComponent();
            Persons.Add(new Person() { Name = "John 1", Age = 25, City = "New Delhi", Email = "abc@abc.com" });
            Persons.Add(new Person() { Name = "John 2", Age = 25, City = "New Delhi", Email = "abc@abc.com" });
            Persons.Add(new Person() { Name = "John 3", Age = 25, City = "New Delhi", Email = "abc@abc.com" });
            Persons.Add(new Person() { Name = "John 4   ", Age = 25, City = "New Delhi", Email = "abc@abc.com" });
           DataContext = this ;
        }
    
        private ObservableCollection<Person> persons;
        public ObservableCollection<Person> Persons {
            get
            {
                return persons;
            }
            set
            {
                persons = value;
                NotifyPropertyChanged("Persons");
            }
        }
    
        #region INotifyPropertyChanged Members
    
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
    
        #endregion
    }
    public class Person
    {
        public string Name { get; set; }
        public string City { get; set; }
        public int Age  { get; set; }
        public string Email { get; set; }
    }
    

    Update : Added Scrollviewer

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

Sidebar

Related Questions

I have an Access form where each record has some info that is computed
I have a tab delimited file where each record has a timestamp field in
I have a list of records in my database and each record is associated
I've been handed a table with about 18000 rows. Each record describes the location
I have a question regarding the two additional columns (timeCreated, timeLastUpdated) for each record
I have a file 'records.txt' which contains over 200,000 records. Each record is on
I'd like to take XML in the format below and load each code record
I have a table that has about 1/2 million records in it. Each month
I have a table called Employees : BeginYear | EndYear | Name 1974 1983
I've got a text file full of records where each field in each record

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.