Export Button is a custom control that let's you export your DataGrid or TextBox data to several different formats. The control is extremely easy to use and also exposes design time features. In this article I will discuss some of the features of the Export Button and how it benefits the developer.


What is Export Button:

Export Button is a custom control that let's you export your DataGrid or TextBox data to several different formats. The control is extremely easy to use and also exposes design time features. In this article I will discuss some of the features of the Export Button and how it benefits the developer.   

Referencing the Export Button:

The Export Button is a simple control which you can add in your toolbox. Simply download the .dll file and add it to your toolbox using the following steps.

1) Click on the toolbox so that you can see all the controls in the toolbox. Right click on the grey area of the toolbox and select "Add/Remove Items".

2) A new window will pop up and from that you can select browse. After selecting browse simply select the .dll file and this way the control will be added to your toolbox.

Using the Export Button:

Simply drag and drop the Export Button on the form. When you drag the button you will see the something like this:

Don't worry the control will render as a button. You can access all the properties of the control by simply right clicking and selecting the properties option.

Export Button Properties:

The Export Button exposes three new properties:

Export Mode: Export Mode property allows the user to select the mode in which he likes to export the data. The Export Mode can be Excel, Text, XML or Word.

FileName: FileName is the name given to the exported file. You can type any name that you want. You should not include the extension of the file when specifying the file name.

TargetControlID: TargetControlID represents the ID of the DataGrid or a TextBox control.

NOTE: The export to XML feature is mainly developed for the DataGrid control. However you can also use it with TextBox control. Simply enter the valid XML in the TextBox and export it to a xml file.

Online Demo: View the online demo.

Download the control