Hi all,
Continuing the previous post on creating a UserControl with Visual C # 2005, had designed the following UserControl:

Now for the example we set in UserControl, and for this we will create 2 control type properties and DataGridView TextBox . And write a script in the event of DataSourceChanged the DataGridView, it will allow me to update the data to be displayed in the DataGridView.
:) Hands-on, let's take a look at our script editor:

First, let's add a line in my constructor:

Second, we will create properties of type DataGridView and TextBox control, then the following script:
Ownership: DataGridView

Ownership: TextBox

Third, we will schedule in the event of DataGridView DataSourceChanged then the following script:

After our script, it should be as follows:

Fourth, we can not access or use this customDataGridView control in the Toolbox, until we have rebuilt the application, because until now, we have not used and for this we also need to rebuild:

Al copilot (build) our application, verify that they generate our control customDataGridView :

0 comments:
Post a Comment