Jump to content
Sign in to follow this  
IElite

Resize TW3Grid columns to ClientWidth ?

Recommended Posts

as the title asks, How do I "Resize TW3Grid columns to ClientWidth ?"

see attached screenshot.

there is a lot of wasted space, but I can't seem to size the columns based on  ClientWidth

e.g.

 GradeCol.Width := fGrid.ClientWidth DIV 4;
 ClassesCol.Width := fGrid.ClientWidth DIV 4;
 StudentsCol.Width := fGrid.ClientWidth DIV 4;
 ProgramCol.Width := fGrid.ClientWidth DIV 4;

I have tried calling these from FormActivate, OnResize, etc....doesn't seem to work

Now, If I assign values in the InitializeObject method

fGrid:= TW3Grid.Create(fContents);
...
ClassesCol := TW3TextColumn.Create(fGrid as IW3ColumnsControl);
GradeCol.Width := 50;

the widths show up correctly, but then I can't change then after my resizing occurs and the grid is resized in the Resize method.

if assigned(fContentsLayout) then
  begin
   fContentsLayout.Resize(fContents);
   GradeCol.Width := fGrid.ClientWidth DIV 4;
   ClassesCol.Width := fGrid.ClientWidth DIV 4;
   StudentsCol.Width := fGrid.ClientWidth DIV 4;
   ProgramCol.Width := fGrid.ClientWidth DIV 4;
  end;

this code above does not work

the short of it is ........column widths do NOT seem to be able to be changed anywhere except in the creation of the columns in InitializeObject method

 

screenshot.png

Edited by IElite
image (screenshot) attachment

Share this post


Link to post
Share on other sites

hmmm, looks like there is a content property of type Tw3ScrollContent, which the columns get created on

so, do I need to size the Content to Grids Width? If so, how? Then resize the Columns based on Content width afterwards?

 

in either way, I dont seem to be able to change the col widths anyways, only in the InitializeObject

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×