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
Using UltraGridBagLayoutManager
posted

the documentation refers to rows and columns, however there are no API's to allow the manipulation of this. It in now way documented the same as UltraGridBagLayoutPanel even though the fist part of the documentation says it works exactly like the ...Manager. 

Anyway I am trying to design a survey form. The contents of the form is not known at design time, I need to be able to place a series of questions and responses (radio, checkbox, and text) at run-time and have the form look reasonable and be scrollable to get through all of the questions.

Parents
  • 469350
    Offline posted

    Hi Lee, 

    There is no public Columns or Rows collection in the GridBagLayoutManager. The way GridBagLayouts work is that the rows and columns are logical rows and columns and they are calculated based on the GridBagLayout settings for each object in the layout. 

    I'm not entirely sure if a GridBagLayout would actually help you here for what you are trying to do. It's basically just another way of arranging controls in a container and there is a bit of a learning curve, so you might be better off just positioning your controls using the Anchor or Dock properties in DotNet. 

    If you have a screen shot or a mock of how one or two of your survey questions might look, I could probably whip up some quick sample code to show you how to achieve that using the GridBagLayout. 

    Presumably you want one survey question per line, so I imagine an UltraPanel that contains all of the questions and handles the scrolling and then each question is an UltraGridBagLayoutManager. 

    Of course, another option you might want to think about is that it's likely your survey questions don't have an infinite variety of possible configuration. So if there are a limited number, maybe a UserControl for each layout might make sense and then you just plug in the different question and answer text. 

Reply Children