---
title: "Bind DataTable To Textbox UserControl"  
description: "Bind DataTable To Textbox UserControl"  
author: "Anonymous User"  
published: 2014-01-31  
updated: 2014-01-31  
canonical: https://www.mindstick.com/forum/1929/bind-datatable-to-textbox-usercontrol  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Bind DataTable To Textbox UserControl

I searched a lot for this [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) but i did not find any clear [post](https://www.mindstick.com/articles/12829/aspects-that-make-australia-post-shipping-extension-a-useful-tool) about that.

I do databinding with this [command](https://www.mindstick.com/blog/178/synchronous-and-asynchronous-command-execution-in-c-sharp-dot-net):

userControl11.DataBindings.Clear();

userControl1.DataBindings.Add( "[Text](https://www.mindstick.com/blog/301635/did-people-reinvent-texting-to-express-the-full-range-of-emotions)",dt,"DM" );

I also [put](https://answers.mindstick.com/qa/111890/can-you-explain-the-difference-between-put-and-post-http-methods) dt for [datagridview](https://www.mindstick.com/articles/607/working-with-datagridview-in-vc-sharp) datasource.

this work for usual [controls](https://www.mindstick.com/articles/66/how-to-create-controls-at-run-time-in-csharp-dot-net) but not for usercontrols.

[Now](https://yourviews.mindstick.com/view/81402/it-s-liberals-vs-progressives-in-us-politics-now) the Text of the [usercontrol](https://www.mindstick.com/forum/12739/set-the-enabled-property-of-a-usercontrol-from-codebehind) does not change if i [select](https://www.mindstick.com/forum/160534/orderby-then-select-vs-select-then-orderby-performance) different rows of datagridview and it is always empty.

I think this problem is simple.Should I use INotifyPropertyChanged?

## Replies

### Reply by Pravesh Singh

Hi Ankit,\

simply I did this in Usercontrol :

```
  public override string Text    {        get { return txtmoney.Text; }        set        {            txtmoney.Text = value;        }    }
```

And this to bind in my form :

uctextbox1.DataBindings.Add( "text",DT,"DM" );


---

Original Source: https://www.mindstick.com/forum/1929/bind-datatable-to-textbox-usercontrol

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
