Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I change the column width of Hierarchical FlexGrid?

Status
Not open for further replies.

ii128

Programmer
May 18, 2001
129
US
I have a Hierarchical FlexGrid the layout as follow:


Company ID Company Name Department Employee Name
1 BB. Inc HR Lucy
Danny
IS Candy
Daicy
2 ABC. Inc HR Steve
Fanny
IS Nancy


Any one can help me That?

How can I change the column width of Department and Employee Name to 2000

I have tried that:

FlexGrid.ColWidth(2) = 5000
FlexGrid.ColWidth(3) = 5000

But It doesn't work. Anyone can help me correct?
 
Try this
flexgrid.col = 2
flexgrid.colwith(2) = 2000

flexgrid.col = 3
flexgrid.colwidth(3) = 2000
 
75cl,

No, The text in the column move to another column, the whole grid totally mix up.
 
try this:

flexgrid.col = 2
flexgrid.colwith(2) = 2000
flextgrid.row = 0

do the same thing for department name column
 
No, it doesn't help??? Any other way to do that?
 
Ouch !

Check the Property Page for the control on the form.
Is AllowUserResizing set?

(If it's set to 0-None, you got nooo chance!)
 
The Problem is I don't want the User to Resize the column width, I want to fix the column width and try to change the column width in the coding.
 
Is there any "refreshing" or reinitializing of the grid that may be accidentally happening before the focus returns to it for the user?
 
OK, so turn off user resizing once you've customised it...

With flexgrid
.AllowUserResizing = flexResizeBoth
' Whatever....
.Col = 2
.colwidth(2) = 2000

.Col = 3
.ColWidth(3) = 2000

.AllowUserResizing = flexResizeNone
End With

...or am I missing something?
 
comaboy,

No, The grid still mix up.
 
Probably because the column numbers start at 1 and the index starts at 0.
 
Have you tried setting the column sizes before populating the grid?

..and how exactly is it 'mixing up'?
 
I don't know how to set the column sizes before populating the grid.
 
'K,

Can't you just populate the grid,
AllowUserResizing = True,

Change col widths,

AllowUserResizing = False?
 
Flexgrid.FormatString = "CompanyID|CompanyName|Department|Employee Name"
Flexgrid.ColWidth(0) = x
Flexgrid.ColWidth(1) = x
Flexgrid.ColWidth(2) = 2000
Flexgrid.ColWidth(3) = 2000

You dont need to set AllowUserResizing = True if you dont want users to resize it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top