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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FLEX GRID HELP PLEASE 1

Status
Not open for further replies.

goatsaregreat

Programmer
Mar 21, 2001
82
0
0
GB
I have a flex grid on a form. It has records in it that are queried from a DB. My problem is... How can I resize the cells or columns. They are too small for some of the data fields. Is there a property to make these wider? I cannot figure this one out. Please Pronto!
TIA
 
MSFlexGrid1.ColWidth(0) = 500
MSFlexGrid1.ColWidth(1) = 500
MSFlexGrid1.ColWidth(2) = 500

(0) = col

 
Ok kids, the answer of savok is Ok, but learn more with the next code:

' Assign SQL string to execute and Connection String to
' Data control

data1.RecordSource = RecSource
data1.ConnectionString = cnString
data1.Refresh

' Assign the width of each column automatically, depending
' field width in the Database!! Cool !!

Dim I, mleft As Integer
For I = 0 To data1.Recordset.Fields.Count - 1
MSFlexGrid1.ColWidth(I,0)=((data1.Recordset.Fields.Item(I).DefinedSize-1)*100)+310
Next I


Enjoy it !! :)
Alex Molina

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top