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
170
Disable autogeneration of columns
posted

Hi there,

Probably you have seen this question more than once, but this is really critical for our business now.

We have to buy a new set of controls to enrich our user experience. I have been testing with WinGrid, but it has a very specific problem: it autogenerates columns.

Our database generation tool automatically creates views of underlying tables, which makes it have a lot of columns (in some case above 250). I don't have the time to hide all those fields manually.

Is there a way to disable the auto generation of columns, like the DataGridView does?

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi Patrick,

    No, the UltraGrid always creates columns based on the data source you provide.

    There are a number of ways you can deal with this:

    1) Use the InitializeLayout event of the grid and hide the columns programmatically.

    2) You could set up the grid layout at design-time and add in only the columns you want to see. Here's an article that shows you how.

    HOWTO:How can I define columns in the grid at Design-time and bind them at run-time so that some fields of the data are excluded from the grid?

    3) The UltraWinTree control allows you to turn off the auto-generation of the columns. But it lacks certain grid features like filtering and summaries.

    4) Use the UltraDataSource in the virtual mode as an intermediary between your "real" data source and the grid. The UltraDataSource allows you to work in an on-demand mode where it fires events when data is requested, updated, etc.

    5) IIf you are using a custom data source, I'm pretty sure there is an attribute you can put on a field to hide it from the BindingManager. I'm not sure what the attribute is off the top of my head, but if you want to try this out, let me know and I will see if I can find out.

Children