Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » ArrayCtrl column width problem
ArrayCtrl column width problem [message #22674] Tue, 04 August 2009 13:12 Go to next message
koldo is currently offline  koldo
Messages: 3357
Registered: August 2008
Senior Veteran
Hello all

When adding dinamically columns to an ArrayCtrl the columns do not get the right size until Maximizing the window.

Grid is defined like this:

grid.MultiSelect().HeaderObject().Absolute().Clipboard();


Before filling the grid:

grid.Reset();


And during program running columns are added dinamically (only when needed) like this:

tabGrid->grid.AddColumn("", 100);


Doing this it is got:

index.php?t=getfile&id=1874&private=0

After doing a Maximize it is viewed right:

index.php?t=getfile&id=1875&private=0

Best regards
Koldo
  • Attachment: Dib1.PNG
    (Size: 8.88KB, Downloaded 555 times)
  • Attachment: Dib2.PNG
    (Size: 15.25KB, Downloaded 615 times)


Best regards
Iñaki
Re: ArrayCtrl column width problem [message #22675 is a reply to message #22674] Tue, 04 August 2009 14:02 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Tue, 04 August 2009 07:12

Hello all

When adding dinamically columns to an ArrayCtrl the columns do not get the right size until Maximizing the window.

Grid is defined like this:

grid.MultiSelect().HeaderObject().Absolute().Clipboard();


Before filling the grid:

grid.Reset();


And during program running columns are added dinamically (only when needed) like this:

tabGrid->grid.AddColumn("", 100);


Doing this it is got:

index.php?t=getfile&id=1874&private=0

After doing a Maximize it is viewed right:

index.php?t=getfile&id=1875&private=0

Best regards
Koldo


Unless you are in Absolute mode, these numbers represent ratio.

If this does not explain the behaviour, I need some testcase Smile

Mirek
Re: ArrayCtrl column width problem [message #22676 is a reply to message #22675] Tue, 04 August 2009 17:48 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3357
Registered: August 2008
Senior Veteran
Hello Mirek

Problem found.

After doing a Reset() it seems the grid "forgets" its configuration.

To solve it before filling the grid and after Reset() the grid has to be reconfigured. So now to clean the grid:

grid.Reset();
grid.HeaderObject().Absolute();


so the following AddColumn() will fill the grid properly.

Best regards
Koldo


Best regards
Iñaki
Re: ArrayCtrl column width problem [message #22688 is a reply to message #22676] Wed, 05 August 2009 09:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Tue, 04 August 2009 11:48

Hello Mirek

Problem found.

After doing a Reset() it seems the grid "forgets" its configuration.

To solve it before filling the grid and after Reset() the grid has to be reconfigured.


Of course it is. That is what Reset is for (set default values).

Mirek
Re: ArrayCtrl column width problem [message #22689 is a reply to message #22688] Wed, 05 August 2009 12:18 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3357
Registered: August 2008
Senior Veteran
Hello Mirek

Quote:

Of course it is. That is what Reset is for (set default values).


So what is the way for just removing all rows and columns ?

Best regards
Koldo


Best regards
Iñaki
Re: ArrayCtrl column width problem [message #22690 is a reply to message #22689] Wed, 05 August 2009 13:41 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
No columns is default status.

Mirek
Re: ArrayCtrl column width problem [message #22695 is a reply to message #22690] Wed, 05 August 2009 22:41 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3357
Registered: August 2008
Senior Veteran
Sorry Mirek

I mean removing all rows and columns after filling an ArrayCtrl with rows and columns.

Best regards
Koldo


Best regards
Iñaki
Re: ArrayCtrl column width problem [message #22696 is a reply to message #22695] Wed, 05 August 2009 23:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Wed, 05 August 2009 16:41

Sorry Mirek

I mean removing all rows and columns after filling an ArrayCtrl with rows and columns.

Best regards
Koldo


The answer is the same. Reset puts ArrayCtrl into default status. Use Reset.

Now of course, maybe the question is "what to use to remove columns only". We could have separate method for this.

Anyway, if you think about the issue, you have to have some code to setup your ArrayCtrl, like using that Absolute mode. It is quite logical to have this code in the same place where you setup columns...

Mirek
Re: ArrayCtrl column width problem [message #22697 is a reply to message #22696] Thu, 06 August 2009 09:24 Go to previous message
koldo is currently offline  koldo
Messages: 3357
Registered: August 2008
Senior Veteran
Hello Mirek

I am going to do it.

Thank you
Koldo


Best regards
Iñaki
Previous Topic: Accessing embedded controls in a gridCtrl
Next Topic: Substring formating in ArrayCtrl (SqlCtrl)
Goto Forum:
  


Current Time: Sat Apr 27 15:24:27 CEST 2024

Total time taken to generate the page: 0.06241 seconds