DataGridView Extension FAQ


  1. Can I redistribute DataGridView Extension freely?
  2. Which component does the DataGridView Extension extends?
  3. How is DataGridView Extension integrated?
  4. Which version of .NET framework is supported by DataGridView Extension?
  5. In what programming language is DataGridView Extension written?
  6. What are the requirements in order to have a DataGridView control managed by the DataGridView Extension?
  7. Does DataGridView Extension have design time support?
  8. To which assemblies do I have to add reference in my project?
  9. How DataGridView Extension stores its data?
  10. Where is all Xml data stored on the user’s computer?
  11. Does DataGridView Extension support custom columns?
  12. How is the export functionality working?
  13. Which version of MS Excel is supported by the export?
  14. Is there end user manual for DataGridView Extension available for download?
  15. Is it possible to extend the functionality provided by the DataGridView Extension?
  16. Code Sample: Extending DataGridView control using the DGV Extension.
  17. Code Sample: How to change the Xml persistence folder.
  18. Code Sample: Exporting DataGridView control contents to MSExcel using the DGV Extension.
  19. Code Sample: Exporting DataGridView control contents to Html using the DGV Extension exporter.
  20. Why I get warning message saying 'There is grid without name that will not be managed' when all of my grids do have names?
  21. Why the colors of my column and row headers are not applied although I have changed them?
  22. Does DataGridView Extension component inherit the standard DataGridView control?

  1. Can I redistribute DataGridView Extension freely?
    DataGridView Extension is a component that can be redistributed freely only as a part of applications. You can check its license here. top
  2. Which component does the DataGridView Extension extends?
    The component extended by the DataGridView Extension is the standard DataGridView provided in .NET 2.0 framework. top
  3. How is DataGridView Extension integrated?
    DataGridView Extension integrates itself by adding extension button on the top left corner of the grid. It also integrates its context menu as sub-menu item in case DataGridView control has context menu. In case underlying control does not have context menu, the extension sets its own menu as context menu. top
  4. Which version of .NET framework is supported by DataGridView Extension?
    DataGridView Extension works under .NET 2.0 and is compatible with Visual Studio.NET 2005. top
  5. In what programming language is DataGridView Extension written?
    DataGridView Extension is written entirely in C# but you can use it in any project written in any language supported by .NET framework. top
  6. What are the requirements in order to have a DataGridView control managed by the DataGridView Extension?
    There are two things you have to ensure: first is a valid Name set to the data grid view control and second is permission to write the Xml files to the hard drive. top
  7. Does DataGridView Extension have design time support?
    Yes it has design time support. Its behavior is exactly like using ToolTip component. You just have to drag & drop DataGridView Extension Component on your root container from the toolbox then select the grid you wish to manage and set the value of its property ‘IsManagedByExtension’ to true, and that is all. top
  8. To which assemblies do I have to add reference in my project?
    In order to use DataGridView Extension in your project you have to add references to the main assembly ‘DataGridViewExtension.dll’, Xml persistence optimizer ‘DataGridViewExtension.XmlSerializers.dll’ and all other export DLLs like ‘DGVEExcelExporting.dll’, ‘DGVEHtmlExporting.dll’ etc. you wish to be supported by your application. top
  9. How DataGridView Extension stores its data?
    All of the data is stored entirely in Xml format and is ready for further processing. top
  10. Where is all Xml data stored on the user’s computer?
    By default all Xml files are stored in the following folder ‘C:\Documents and Settings\{Username}\Application Data\{CompanyName}\{ApplicationName}\{ApplicationVersion}\’ but it can easily be changed programmatically to any other location - see example. All themes are located in folder ‘Themes’ so it is easy to be exchanged. top
  11. Does DataGridView Extension support custom columns?
    Yes, the DataGridView Extension supports custom columns. The only requirement to these columns is to have default constructor without parameters. top
  12. How is the export functionality working?
    The export functionality of DataGridView Extension is plug-in based. On startup of the application the export manager looks for DLLs marked with a specific attribute and displays them in the Export menu. In case you want to add or remove export to specific file format you just have to add or remove the appropriate DLL from the working folder. For example if you do not want to have export to MS Excel, remove the appropriate assembly ‘DGVEExcelExporting.dll’. top
  13. Which version of MS Excel is supported by the export?
    DataGridView Extension can export to MS Excel XP and later versions. top
  14. Is there end user manual for DataGridView Extension available for download?
    Yes it is available and can be downloaded from here. top
  15. Is it possible to extend the functionality provided by the DataGridView Extension?
    Yes it is possible; developer’s manual is available for download. It shows how this can be done. top
  16. Code Sample: Extending DataGridView control using the DGV Extension.
    In order to extend a DataGridView control with the DGV Extension you have to:
    1. 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’ and/or ‘DGVEHtmlExporting.dll’. The assemblies can be found in folder 'v1.1.1\Bin' in the installation\archive.
    2. First ensure you have the following imports:

      C#
      using CompletIT.Windows.DataGridViewExtension;

      VB.NET
      Imports CompletIT.Windows.DataGridViewExtension
    3. Then, after the creation of the instance to DataGridView control(s) add the following lines:

      C#
      DataGridViewExtensionComponent dgvExtension = new DataGridViewExtensionComponent ();
      dgvExtension.SetManagedByExtension( dataGridView, true );
      //Manage other grids here ...

      VB.NET
      Dim DGVExtension As DataGridViewExtensionComponent = New DataGridViewExtensionComponent()
      DGVExtension.SetManagedByExtension( Me.DataGridViewControl, True )
      'Manage other grids here ...
    4. Run your application!

    top
  17. Code Sample: How to change the Xml persistence folder.
    It is possible to change the default folder where all Xml data is saved, you just have to insert the following lines of code in your application:
    1. Add reference to the main assembly ‘DataGridViewExtension.dll’ and to any of the export dlls you wish to be supported. The assemblies can be found in folder 'v1.1.1\Bin' in the installation\archive.
    2. Ensure you have the following imports:

      C#
      using CompletIT.Windows.DataGridViewExtension;
      using CompletIT.Windows.DataGridViewExtension.Persistence;

      VB.NET
      Imports CompletIT.Windows.DataGridViewExtension
      Imports CompletIT.Windows.DataGridViewExtension.Persistence
    3. Then add the following lines of code in order to change the persistence folder:

      C#
      //The new destination folder should be existing
      DGVEXmlPersistenceManager.ExtensionSettingsPath = "C:\\MyNewPersistenceFolder";
      DataGridViewExtensionComponent.Extension.UpdateAllGridsWithPersistedSettings();
      DGVEThemesManager.UpdateListWithSavedThemes();

      VB.NET
      'The new destination folder should be existing
      DGVEXmlPersistenceManager.ExtensionSettingsPath = "C:\\MyNewPersistenceFolder"
      DataGridViewExtensionComponent.Extension.UpdateAllGridsWithPersistedSettings()
      DGVEThemesManager.UpdateListWithSavedThemes()
    4. Run your application!

    top
  18. Code Sample: Exporting DataGridView control contents to MSExcel using the DGV Extension.
    It is possible to use separately the export functionality to MSExcel provided by DataGridView Extension. There are some simple steps outlined below you have to follow.
    1. Add reference to the main assembly ‘DataGridViewExtension.dll’ and export dll ‘DGVEExcelExporting.dll’. The assemblies can be found in folder 'v1.1.1\Bin' in the installation\archive.
    2. First ensure you have the following imports:

      C#
      using CompletIT.Windows.Forms.Export.Excel;

      VB.NET
      Imports CompletIT.Windows.Forms.Export.Excel
    3. Then add the following code in the event handler that has to perform the export:

      C#
      DGVEExcelExportSettings exportSettings = new DGVEExcelExportSettings();
      exportSettings.ExportFileName = ...//Export file name
      exportSettings.OpenFileAfterGeneration = true; //Open generated file after export
      //Set other settings here...
      DGVEExcelExporter exporter = new DGVEExcelExporter();
      exporter.Export( dataGridView, exportSettings );

      VB.NET
      Dim ExportSettings As DGVEExcelExportSettings = New DGVEExcelExportSettings()
      ExportSettings.ExportFileName = ...'Export file name
      ExportSettings.OpenFileAfterGeneration = True 'Open generated file after export
      'Set other settings here...
      Dim Exporter As DGVEExcelExporter = New DGVEExcelExporter()
      Exporter.Export(Me.DataGridViewControl, ExportSettings)
    4. Run your application!

    top
  19. Code Sample: Exporting DataGridView control contents to Html using the DGV Extension exporter.
    It is possible to use separately the export functionality to Html provided by DataGridView Extension. There are some simple steps outlined below you have to follow.
    1. Add reference to the main assembly ‘DataGridViewExtension.dll’ and export dll ‘DGVEHtmlExporting.dll’. The assemblies can be found in folder 'v1.1.1\Bin' in the installation\archive.
    2. First ensure you have the following imports:

      C#
      using CompletIT.Windows.Forms.Export.Html;

      VB.NET
      Imports CompletIT.Windows.Forms.Export.Html
    3. Then add the following code in the event handler that has to perform the export:

      C#
      DGVEHtmlExportSettings exportSettings = new DGVEHtmlExportSettings();
      exportSettings.ExportFileName = ...//Export file name
      exportSettings.OpenFileAfterGeneration = true; //Open generated file after export
      //Set other settings here...
      DGVEHtmlExporter exporter = new DGVEHtmlExporter();
      exporter.Export( dataGridView, exportSettings );

      VB.NET
      Dim ExportSettings As DGVEHtmlExportSettings = New DGVEHtmlExportSettings()
      ExportSettings.ExportFileName = ...'Export file name
      ExportSettings.OpenFileAfterGeneration = True 'Open generated file after export
      'Set other settings here...
      Dim Exporter As DGVEHtmlExporter = New DGVEHtmlExporter()
      Exporter.Export(Me.DataGridViewControl, ExportSettings)
    4. Run your application!

    top
  20. Why I get warning message saying 'There is grid without name that will not be managed' when all of my grids do have names?
    The Name is the only necessary property that DataGridView Extension needs in order to manage a DataGridView control. If there is no Name defined the Extension cannot recognize the DataGridView and therefore cannot save any settings for it. Nevertheless it is possible to get this message sometimes in version 1.0 even for grids that do have names defined. The reason for this is the sequence of the code generated design time. Workaround for this problem is to open the source code find the call to the extension:

    C#
    dgvExtension.SetManagedByExtension( dataGridView, true );

    VB.NET
    DGVExtension.SetManagedByExtension( Me.DataGridViewControl, True )
    and move it after the line where the Name of the same DataGridView control is set so finally you will have:

    C#
    dataGridView.Name = "dataGridView";
    dgvExtension.SetManagedByExtension( dataGridView, true );

    VB.NET
    DataGridViewControl.Name = "dataGridView"
    DGVExtension.SetManagedByExtension( Me.DataGridViewControl, True )

    This problem is fixed in version 1.1.

    top
  21. Why the colors of my column and row headers are not applied although I have changed them?
    If you want to change the colors of the row and column headers you have to ensure that the option ‘Use Windows Visual Styles’ is not checked in the Header Styles editor - by default this option is checked which means that all headers are using the default colors defined by the system.

    top
  22. Does DataGridView Extension component inherit the standard DataGridView control?
    No, DataGridView Extension component just decorates the standard DataGridView control provided in .Net 2.0 Framework without any inheritance and with just single line of code.
    top