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
260
Building a dynamic grid on the fly?
posted
Could the following be accomplished with the UltraGrid control and how (example, documentation, etc...)Basically I'll have a form with a single grid, the user will select items from a combo box which then populates the UltraGrid, and each item could have a view with a different column layout.1. Populate an UltraGrid with a given view, and have the grid layout reflect the views columns. If user selects a different view, have the grid reflect its column layout, both views have different number of columns, in a sense the grid would have to be dynamic in its layout based on whatever view is used as it's data source.2. Hide columns in a grid, is there a way to select on a column at runtime in the grid and hide it? Any information is greatly appreciated. Best Regards, Nick

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Nick,

    Everything you have here sounds not only doable, but pretty easy. All you would have to do is set the DataSource on the grid and it will automatically pick up the structure of the data source you assigned. You could use the Load and Save methods on the grid's DisplayLayout to save the last layout for each different view, so that when the user switches away from a view and back, the grid would maintain the column sizing, position, sorting, etc. that they had the last time they viewed it. 

    Regarding the hiding of columns, you can use the ColumnChooser for this. The easiest way to do this is touse the RowSelectorHeaderStyle property and set it up as a ColumnChooser button. Then the users can click it and it brings up a list of the column that they can show / hide just like Microsoft Outlook has. 

     

Children