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 » GridCtrl::Reset does not reset.
GridCtrl::Reset does not reset. [message #25703] Mon, 08 March 2010 20:34 Go to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Hi,

It would be good to have a GridCtrl function which completely reset the control (not necessarily the settings but certainly the columns and data). When I add a bunch of columns and then Reset and add them again then the display gets messed up. I've also tried GridCtrl::Clear(true) and that doesn't appear to work either.

Basically I want to be able to add a bunch of columns and data and then update the data and do it all again.

Nick



Re: GridCtrl::Reset does not reset. [message #25706 is a reply to message #25703] Mon, 08 March 2010 21:36 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
nixnixnix wrote on Mon, 08 March 2010 20:34

Hi,

It would be good to have a GridCtrl function which completely reset the control (not necessarily the settings but certainly the columns and data). When I add a bunch of columns and then Reset and add them again then the display gets messed up. I've also tried GridCtrl::Clear(true) and that doesn't appear to work either.

Basically I want to be able to add a bunch of columns and data and then update the data and do it all again.

Nick





Hello nixnixnix

I use usually Clear(true) and it cleans data and columns.

Could you pass a working code sample about it ?


Best regards
IƱaki
Re: GridCtrl::Reset does not reset. [message #25707 is a reply to message #25703] Mon, 08 March 2010 22:00 Go to previous message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Reset works fine. I wrote about this column problem many times here (this means I have to redesign it as it's not intuitive Smile).
Just put all your AddColumns between following method calls:
grid.Ready(false);
grid.AddColumn(...);
grid.AddColumn(...);
grid.Ready(true);

This display mess happens only in proportional mode and only if grid is visible on the screen. It is so because each AddColumn recalculates columns proportions being not aware of next AddColumn calls. I'll put this issue on my todo list.
Previous Topic: Calculate needed cell width to fit some text
Next Topic: Proposal: add WhenScroll to ArrayCtrl
Goto Forum:
  


Current Time: Fri Apr 19 02:03:49 CEST 2024

Total time taken to generate the page: 0.02392 seconds