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
355
layouts for exporting and screen??
posted

using v9.2

is it possible to have two (or more) layouts defined such that one is only used for exporting and one for display. I have many grids and a method that exports any of them to excel.  Unfortunately I want to hide different columns from different grids.  I can always pass a list of columns keys to exclude and using the BeforeExport event to hide them, but it would be nice if each grid could be created with that information at design time.

I thinking along the lines of the media type in CSS.

thanks

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    The export layout is only exposed via the BeginExport event. So you have to use the event to modify the layout.

    However, Layouts have Load and Save methods. So you could save a layout at design-time and then simply load that layout into the ExportLayout inside the event.

    You can load and save layouts in the grid at design-time using the Layout Wizard, which is available by right-clicking on the grid. So you could save your grid's current display layout, either to a file or to the Layouts collection of the grid. Then you could modify it however you want for exporting and save that layout. Then load the original display layout back into the on-screen grid, and in the BeginExport event, load the saved export layout into the ExportLayout.

Children
No Data