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
560
Setting AutoSizeMode in the designer
posted
I have a UltraGrid that is bound at runtime. I design my bands and columns in the design mode and set the AutoSizeMode-property of my columns to AllRowsInBand. At runtime, I use the setdatabinding()-method to bind my data to the grid, but this seems to throw away some of my settings I set in the designer. The width of the columns seems to be the default-width shown in the designer, there is no effect of the AutoSizeMode. When I use PerformAutoResize after the databinding, this works just like expected. Is there a way to re-set the designer settings after the databinding? I would like to resize all my columns to the maximum width of the cells, except the last column. The last one should use the remaining space in the grid or more, when the column would not fit into it.. Thanks in advance, Stefan
Parents
No Data
Reply
  • 469350
    Offline posted

    Hi Stefan,

    If the grid is losing it's layout when you call SetDataBinding, it means that the data source you are binding to does not match the schema you set up at design-time in some way. 

    Perhaps one of the band or column keys does not match up. 

    Personally, I find it much easier to set up the layout of my grid using the InitializeLayout event, rather than the designer. The VS form designer tends to be a bit flaky when dealing with data source notifications and can sometimes cause the layout to be reset when it doesn't seem to need to.

Children