Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
How To Save Entire Grid Structure
posted

We are re-writing an application that has languished without maintenance for 7 years.  Our customer’s requirement is to provide data entry screens with grids.  Each grid will have a different structure (database fields, number of columns, differing columns with combo boxes, date pickers, etc).  I have a little over 80 screens (40 data entry and 40 error editor) to create and each screen has the exact same functionality other than the data displayed in the grid (pop-up menus, toolbars, etc). I would like a way to save the entire layout, bindings, etc so that I will actually only have one data entry screen and one error editor screen and then can load the appropriate grids layout, structure, etc..  In the older application using a ComponenetOne (was Apex) dbTrueGrid I was able to do the following:

  1. Associate the grid to a datasource
  2. Order the columns appropriately
  3. Associate specific columns to comboboxes (I knew the maximum number of comboboxes I needed)
  4. Specify the datasource for each combobox associated in step 3 (The comboboxes are associated to lookup tables)
  5. Specify appropriate column formatting (date, time, number, read-only, locked, etc)
  6. Save everything I had done in steps 2-5 to a single file.
This process allowed me to define a very comprehensive layout/structure of the grid for each of the 40 tables (there are two screens for each table – data entry and error editor that use exactly the same grid layout).  I then only needed to create an instance of the data entry screen, pass in the datasource, load the saved grid information and, hey presto, a screen appears correctly formatted to the user. I know that in the WinGrid there is a DisplayLayout.SaveAsXml method but it appears that this method saves only visual appearance attributes. Can anyone suggest any ideas on how I can save everything about a designed grid (layout, column formatting, associated comboboxes, etc.) so that I don’t have to create and maintain 40 data entry screens and 40 error editor screens.

Thanks

Richard

  • 469350
    Verified Answer
    Offline posted

    The only thing I see here that would not be saved in the grid layout is the data source of the dropdowns. The column order, links from the column to the dropdown control, and formatting of the column are all saved as part of the layout.

    There's nothing in the grid that can save the data source on a control outside the grid, so you would need to handle that manually.

    If you want to include this information in the same file as the layout, then what you can do is save the layout to a Stream. You can then add information to the stream either before or after the layout and use that same information when you load the layout.