DataGridView Extension 1.1.1 Page 1 of 21 Developers’ Guide to DataGridView Ext
DataGridView Extension 1.1.1 Page 1 of 21 Developers’ Guide to DataGridView Extension 1.1.1 Revision date 27 February 2008 DataGridView Extension 1.1.1 Page 2 of 21 Contents 1. General ................................................................................................................................... 4 1.1. Installation structure ....................................................................................................... 4 1.2. Assemblies ....................................................................................................................... 4 2. Common................................................................................................................................. 5 2.1. Supported data sources................................................................................................ 5 2.2. Manage grid view programmatically ......................................................................... 5 2.3. Open settings editor for a managed grid view ......................................................... 6 2.4. Explicit refresh of a managed grid view...................................................................... 6 2.5. Changing Xml persistence folder................................................................................. 7 2.6. Custom columns............................................................................................................. 7 3. Export....................................................................................................................................... 7 3.1. MS Excel ........................................................................................................................... 8 3.2. Html................................................................................................................................... 8 3.3. Pdf..................................................................................................................................... 9 3.4. Export using the default settings................................................................................... 9 3.5. Export using the exporting manager ......................................................................... 10 3.6. Events and error handling ........................................................................................... 11 3.7. Export using the appropriate export settings editor dialog.................................... 11 3.8. Creating custom exporter........................................................................................... 12 3.9. Changing exporters folder.......................................................................................... 12 4. Security.................................................................................................................................. 13 4.1. Default permissions for all grid view controls in the application............................ 13 4.2. Default permissions for all columns in the application............................................ 14 4.3. Permissions for a particular grid view control ........................................................... 14 4.4. Permissions for a particular column ........................................................................... 15 4.5. General permissions for the extension....................................................................... 16 5. Find......................................................................................................................................... 17 5.1. How to find specific cell value ................................................................................... 17 DataGridView Extension 1.1.1 Page 3 of 21 5.2. How to find a value using the find dialog................................................................. 17 6. Print ........................................................................................................................................ 17 6.1. Silent print (No print dialog)......................................................................................... 18 6.2. Print using the print dialog........................................................................................... 18 6.3. Print preview.................................................................................................................. 18 7. FAQ ........................................................................................................................................ 19 7.1. Which component does the DataGridView Extension extends?.......................... 19 7.2. Does DataGridView Extension component inherit the standard DataGridView control?..................................................................................................................................... 19 7.3. In what programming language is DataGridView Extension written? ................. 19 7.4. Which version of .NET framework does DataGridView Extension support? ......... 19 7.5. Does DataGridView Extension have design time support?.................................... 19 7.6. What are the requirements in order to have a DataGridView control managed by the DataGridView Extension? .......................................................................................... 19 7.7. To which assemblies do I have to add references in my project?........................ 19 7.8. How is DataGridView Extension integrated?............................................................ 19 7.9. How DataGridView Extension stores its data?.......................................................... 20 7.10. Where is all Xml data stored on the user’s computer?........................................ 20 7.11. What is the structure of the persistence folder?................................................... 20 7.12. Does DataGridView Extension support custom columns?.................................. 20 7.13. How does the export functionality work?.............................................................. 20 7.14. Which version of MS Excel is supported by the export?...................................... 20 7.15. The export to Excel does not work what should I do?......................................... 20 7.16. How to add DataGridView Extension to my VS.NET 2005 Toolbox? .................. 21 7.17. How many DataGridView controls can be managed by a single instance of the Extension?.......................................................................................................................... 21 7.18. How many instance of the extension can I have in single .NET application? . 21 7.19. Why the colors of my column and row headers are not applied although I have changed them? ............................................................................................................ 21 DataGridView Extension 1.1.1 Page 4 of 21 1. General DataGridView Extension is a component that extends the basic DataGridView control (provided with .NET 2.0 Framework) with additional functionality without inheritance. DataGridView Extension allows both developers and end users to control specific features of the DataGridView control in runtime environment. As part of these features, the appearance and behavior of the control could be modified also. DataGridView Extension provides additional functionality, such as printing, exporting of data and visualization to MS Excel, Pdf documents and Html pages, searching for text in the control and theme management. Major functionality of DataGridView Extension is that it allows persistence and export/import of all changes made to the control: its columns widths, ordering, headers width and height, appearance and behavior. DataGridView Extension has the ability to manage multiple DataGridView controls in a single project and to store all user settings for every and each of them. DataGridView Extension allows saving of themes defined by the customer. Themes greatly reduce the labor needed to set a professional looking application. Customers can change the entire application’s look and feel with a single click by changing the default theme. Themes can be saved in different applications and even backup. The DataGridView Extension comes with a set of custom column types that will give the developer additional functionalities of the grid itself. 1.1. Installation structure The default installation folder is 'C:\Program Files\CompletIT\DataGridView Extension' but during the installation the user can change it. After the installation has finished successfully, the following folder structure is created: \v1.1 \Bin - Contains all DLLs you need to develop applications using DGV Extension; \Help - Contains the end-user manual as Pdf file; \PIAs - Contains the Primary Interop Assemblies (PIAs) and the registry files needed for the export to MS Excel; \Samples \Demo - Demo application DLLs and executable \CSharp - VS.2005 sample project written in C# \VisualBasic.Net - VS.2005 sample project written in VisualBasic.Net 1.2. Assemblies - ‘DataGridViewExtension.dll’ – This is the main assembly of the DataGridView Extension. It contains some major functionality such as Print, Find, Themes support, Xml persistence and others. - ‘DataGridViewExtension.XmlSerializers.dll’ – Xml persistence optimization assembly; this assembly is optional and can be removed freely but keep in mind that it reduces the initial loading time for all persisted Xml settings drastically. DataGridView Extension 1.1.1 Page 5 of 21 - ‘DGVEExcelExporting.dll’ – Export to MS Excel; this assembly is optional and can be removed if the export to MS Excel file format should not be supported; - ‘DGVEHtmlExporting.dll’ – Export to Html; this assembly is optional and can be removed if the export to Html file format should not be supported; - ‘DGVEPdfExporting.dll’ – Export to Pdf; this assembly is optional and can be removed if the export to Pdf file format should not be supported. The assemblies described above are available in folder ‘<InstallationPath>\v1.1\Bin’ created during the installation. All assemblies have version 1.1 and are strongly named so they can be registered in the Global Assembly Cache (GAC). By default they are not. For more information about the assemblies you have to reference from your projects please read ‘To which assemblies do I have to add references in my project’ in the FAQ section. 2. Common Many of the functionalities developed for the DataGridView Extension are accessible not only runtime via the visual editors but also through an API. 2.1. Supported data sources DataGridView Extension supports both bound and unbound grid view controls. All kinds of data sources are supported i.e. BindingSource, DataView, DataTable, DataSet, DataViewManager, custom collections and others. It is important to know that all customizations made to a bound grid view controls are related to its current data source; this means that in a single grid view control you can have different visual representation (themes, sizes, selection etc) depending on the underlying data source. In case the data source is changed the extension will immediately apply the last saved visual settings for the new data source if such exists. Further in the guide you will see how to force such kind of refresh manually using the API. Tip: If you have two or more grid controls in your application that visualize the same type of data i.e. Clients they will share one Xml settings file thus one visual representation, if you set one and the same name to both controls i.e. ‘dgrClients’. 2.2. Manage grid view programmatically Grid view control can be managed by the extension either design time or manually using the API. The sample bellow shows how to do it manually from within your code. Add reference to the main assembly ‘DataGridViewExtension.dll’ and all export DLLs you wish to be supported by the extension in your application like ‘DGVEExcelExporting.dll’. C# using CompletIT.Windows.DataGridViewExtension; //Create instance of the extension and manage the grid control DataGridViewExtensionComponent dgvExtension = new DataGridViewExtensionComponent(); dgvExtension.SetManagedByExtension( dataGridView, true ); //Manage other grids here ... VB.NET DataGridView Extension 1.1.1 Page 6 of 21 Imports CompletIT.Windows.DataGridViewExtension ‘Create instance of the extension and manage the grid control Dim DGVExtension As DataGridViewExtensionComponent = New DataGridViewExtensionComponent() DGVExtension.SetManagedByExtension( Me.DataGridViewControl, True ) 'Manage other grids here ... 2.3. Open settings editor for a managed grid view Run-time the settings editor is accessible though the Extension button available in the upper left corner of the managed grid view control or through its context menu. Below you can see a code snippet showing you how to popup the settings editor using the API. Keep in mind that the settings editor can be opened only for extended grid view controls. After a grid has been managed either manually or design-time by the extension, its settings editor can be opened in the way shown bellow. C# using CompletIT.Windows.DataGridViewExtension; //Note! You can show the settings editor //dialog only for already managed grid view. DataGridViewExtensionComponent.ExtensionUI.ShowEditor( dataGridView ); VB.NET Imports CompletIT.Windows.DataGridViewExtension ‘Note! You can show the settings editor ‘dialog only for already managed grid view. DataGridViewExtensionComponent.ExtensionUI.ShowEditor( Me.DataGridViewControl ) 2.4. Explicit refresh of a managed grid view Visual representation (themes, hidden/frozen columns etc) of a grid view is bound to the underlying data source, so in case the data source is changed the visualization should be also refreshed. In rare cases it uploads/s3/ developers-guide.pdf
Documents similaires
-
20
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Attribution requise- Détails
- Publié le Mai 06, 2022
- Catégorie Creative Arts / Ar...
- Langue French
- Taille du fichier 0.2803MB