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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:42:35+00:00 2026-05-18T19:42:35+00:00

I am a WPF noob and i hope to stop being so one day

  • 0

I am a WPF noob and i hope to stop being so one day (Lol)

Anyways, i am having issues binding a DataTable (Obtained from an OleDBDataAdapter) to a DataGrid. Even though the DataTable is NOT empty, i get nothing on the DataGrid, it only works if i manually setup the ItemsSource property in code-behind. Help? [I want to make this automatic so any changes made to the grid are reflected into the DataTable, enabling me to just use OleDBCommandbuilder to update the Access database itself (Yes, i am lazy :)). I was thinking of extending DataTable to implement INotifyCollectionChanged but im not sure if that’s do-able :S]

XAML:

            <Grid>
                <DataGrid Grid.Column="0" Grid.ColumnSpan="2" x:Name="ListaArticulos" 
                          Padding="-5,0,0,0" AutoGenerateColumns="False" ItemsSource="{Binding Articulos}">
                    <DataGrid.Columns>
                        <DataGridTextColumn IsReadOnly="True" Width="Auto" Header="ID" Binding="{Binding ID}"/>
                        <DataGridTextColumn Header="Nombre Articulo" Binding="{Binding Nombre}"/>
                        <DataGridTextColumn Header="Categoria" Binding="{Binding Categoria}"/>
                        <DataGridTextColumn Header="Valor" Binding="{Binding Valor}"/>
                        <DataGridTextColumn Header="Cantidad" Binding="{Binding Cantidad}" />
                        <DataGridTextColumn Header="Color" Binding="{Binding Color}" />
                        <DataGridTextColumn Header="Material" Binding="{Binding Material}" />
                        <DataGridTextColumn Header="Referencia" Binding="{Binding Referencia}" Width="*"/>
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>

Code-Behind:

    public DataTable _Articulos = new DataTable();

    public DataTable Articulos { get { return _Articulos; } }

    public MainWindow()
    {
        InitializeComponent();
        ListaArticulos.DataContext = this;
        ReadDB();
    }

ReadDB() updates the Articulos DB.

Thanks in advance.

  • 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-18T19:42:36+00:00Added an answer on May 18, 2026 at 7:42 pm

    your code

        InitializeComponent();
        ListaArticulos.DataContext = this;
        ReadDB();
    

    change to

        ReadDB();
        InitializeComponent();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a noob for the WPF. Hope i can find answer. For example,
I'm a noob when it comes to WPF; In win forms I can do
I am a noob to WPF, MVVM and of course MVVMLight, could you pls
.NET/C#/WPF noob here. I'm trying to give a textbox a border based on a
WPF - From Window1 I'm trying to maximize a previously minimized Window2. This is
WPF DataBindings used to make me happy. One thing I've stumbled over just now
This WPF app targets .NET 3.5 and is built with the 4.0 tools from
My WPF application shows a tree of objects having some properties. These properties can
I am a WPF noob, and really need someone to point me to the
I am new to WPF/XAML so please bear with the noob question. I have

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.