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
145
Expandable grid row that displays panel of controls
posted

I’m looking for a way to create grid rows that expand into a user-definable panel of controls. I’ve found a few possibilities that come close but don’t quite do what we want:

  1. - The expandable group box gives us flexibility for the expanded controls, but the header content must be strings
  2. - Using multiple bands allows grid columns in the top-level control, but the expanded info must be grid data
  3. - I’ve looked at the row layout grid option, but I’m not sure if it could be used for a child band and/or if the column headers could be eliminated

Do you have any suggestions?

 

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi Jeff,

    It's a bit tricky to answer this question without knowing more about your requirements.

    What do you mean by "a user-definable panel of controls?" How user-definable are you talking about here? Is this a single control or UserControl? Or are you suggesting that users can create and customize their own controls?

    - The expandable group box gives us flexibility for the expanded controls, but the header content must be strings

    An ExpandableGroupBox has a header that shows text. So I'm a bit confused about what you mean here or what the problem is.

    - Using multiple bands allows grid columns in the top-level control, but the expanded info must be grid data

    Yes, that's true. You would need to structure your data source in such a way that you have parent rows and then child rows. Presumably, this is okay and all you really want to do is change the display of the child data so it's not displayed as typically grid cells.

    - I’ve looked at the row layout grid option, but I’m not sure if it could be used for a child band and/or if the column headers could be eliminated.

    RowLayouts are pretty flexible, but at the end of the day, it's just grid cells in a more complex layout. You can hide the column headers in the child rows, though. So that might work for you if you can arrange your child rows in some kind of layout of grid cells.

    Another option would be to use an UltraControlContainerEditor. This allows you to embed a control into a grid cell. So you could have a child band in your data with a single column and then the data for that column would bind to some Control or UserControl that you created.

    If it's just a single control then that would make things simpler. But then we come back to "user-definable" and I'm not sure what that means. Does that mean the user picks one of a number of possible options? Or is it more complex than that?

    How complicated it the control you would want to display? A control that has a single Value property is very easy to implement, but if you have a complex control with a dozen different TextBoxes or other controls within it then your child data will have to contain an object that has properties for each one and you'd have to handle a lot of the interaction between the grid data, the editor, and the display.

Children