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
690
Serious problems with Column Widths
posted

Hi there.

Ok I'm not new to the Infragistics way of things, been using this UltraWinGrid for the best part of 5 years now. However I'm having an awful time saving and loading column settings. My code is too complex to easily put here, so I'll explain.

I've got a grid which is loaded after a treeview click, during this process it fires various callbacks etc to save the current "state" of the grid and other UI elements the user has changed. When the state is saved, the datasource is changed, InitializeLayout is fired, then my code swoops in afterwards to merge in the user preferences, like which rows are expanded and more importantly column widths.

Now this should work, however doing this repeatedly results in my columns expanding in width each time the code is run. It's almost like it's doing width = myWidth + 10 just to annoy me.

I've tried for hours now, many workarounds. There are some cases that work and don't work, e.g.:

  1. Setting child band column widths only
  2. Setting the widths forwards for the parent band only
  3. Setting the widths backwards, starting with the last column in the child band
  4. Doing each exclusively so I don't set Band[0].Column[0] AND Band[1].Column[0]

UPDATE

I just tried setting AllowColSizing = AllowColSizing.Free and the effect is no longer visible. However my code is only setting ONE column index from each band so it's not fully tested.

Does this make any sense to anyone? How can I set sizes after InitializeLayout effectively?

UPDATE 2

Right it's definitely somehow linked with Synchronized columns. My code works perfectly in Free mode.

Thanks, Tom