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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:41:40+00:00 2026-05-24T09:41:40+00:00

I know a way to do MVC binding of one string to one TextBox.

  • 0

I know a way to do MVC binding of one string to one TextBox. That’s how it can be done:

C#:

namespace WpfApplication4
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            DataContext = Model;
        }

        public ModelClass Model = new ModelClass();

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            Model.Output += "Setting New Output! ";
        }

        public class ModelClass : INotifyPropertyChanged
        {
            string _output;
            public event PropertyChangedEventHandler PropertyChanged = 
                         delegate { };    
            public string Output
            {
                get { return _output; }
                set { _output = value;
                    PropertyChanged(this, 
                                    new PropertyChangedEventArgs("Output"));
                }
            }
        }
    }
}

XAML:

<Window x:Class="WpfApplication4.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Button Content="Button" VerticalAlignment="Top"  
                Name="button1"  Click="button1_Click" />
        <TextBox  VerticalAlignment="Bottom"  
                  Name="textBox1" Text="{Binding Path=Output}" />
    </Grid>
</Window>

But I can’t find a way to bind a two-dimensional array (or List) to a Grid or DataGrid. Can you help me with it? I couldn’t find a working example on SO.

  • 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-24T09:41:41+00:00Added an answer on May 24, 2026 at 9:41 am

    Consider using a DataGrid to display your two-dimensional array, assuming you can store your data as a List<ColumnData> where ColumnData is a class with one property per table column.

    The WPF SDK contains a DataGrid, and there are several data grids from vendors available that have additional features.

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

Sidebar

Related Questions

Does anyone know a way to auto-generate database tables for a given class? I'm
does anyone know a way to call a generic method of a base class
Any one know a way in delphi get a simple list (eg tstrings) of
I've got the following ActionResult in a ASP.NET MVC 3 project: public ActionResult Index(string
I know the easy way to get to an SSL page in ASP.NET MVC
Does anybody know a way with JavaScript or CSS to basically grey out a
Does anybody know a way to recursively remove all files in a working copy
Does anyone know a way to find out programatically which physical disk holds a
Does anyone know a way to open up an instance of the operating system
Does anyone know a way to open a 2nd form in a .NET application

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.