RE: Grid Control: getting original checkbox state
- Posted by Phil Russell <pg_russell at lineone.net> Feb 10, 2003
- 455 views
Hi Dan, So you want the grid to dynamically resize to fit its contents? Well there is nothing stopping you resizing the grid using 'setRect' as with any other windows control. You can get hold of the row header and row height values (both grid level properties) and size the grid accordingly. However as far as I know a) Windows list controls do *not* have this resizing behaviour b) It would be of limited usefulness except on simple forms as you would then have to shuffle around any other items which appeared below the grid. In addition, my experience with developing Windows apps is that users intensely dislike interfaces which suddenly change themselves around - IMHO it is better to have a fixed size control which stays put. That said, if you *really* need to do this then I am happy to write an example program. Let me know... Regards, Phil PS I will have to log off soon - will reply tomorrow if needed. Dan Moyer wrote: > Hi Phil, > > Well, that's close but not exactly what I meant; refer to the demo > following > this (& if it's a poor way to do what I'm trying to do, by all means > make > corrections!). > > Consider when a Grid Control is created: it shows up as a rectangle of > x-y > dimensions, even though it could be *empty* to begin with. Then add > *one* > row of data: the row shows up, but inside an otherwise *empty* > rectangle. > If you then add additional rows of data, eventually it will have to > vertically scroll, which it does. > > What I am suggesting is that when it *originally* shows, if it has no > data, > just the top legends should (optionally) show; then, if *one* row is > added, > *just that row* would show under the legends, *not* the whole empty grid > rectangle. And then, as now, when enough rows are added so there's not > enough space for them, scroll bars obtain. > > Dan Moyer >