|
-
Oct 29th, 2000, 06:05 PM
#1
Thread Starter
Member
If the text in a msflexgrid cell is longer than the column width, my text is cutoff. I don't want to use word wrap. How can I get the column width set so my text is not cut off? And I want to have the scroll bars too.
Thanks in advance,
Chris.
-
Oct 29th, 2000, 06:58 PM
#2
Addicted Member
No other choice... use wordwrap man... :<
-
Oct 29th, 2000, 06:59 PM
#3
Lively Member
they make you do it manually
Code:
Private Sub Form_Load()
MSFlexGrid1.ColWidth(0) = 2000
MSFlexGrid1.ColWidth(1) = 2000
End Sub
-
Oct 30th, 2000, 11:09 AM
#4
Here is a Generic routine I've put together a while back:
Code:
Public Sub ResizeGrid(pGrid As MSFlexGrid, pForm As Form)
Dim intRow As Integer
Dim intCol As Integer
With pGrid
For intCol = 0 To .Cols - 1
For intRow = 0 To .Rows - 1
If .ColWidth(intCol) < pForm.TextWidth(.TextMatrix(intRow, intCol)) + 100 Then
.ColWidth(intCol) = pForm.TextWidth(.TextMatrix(intRow, intCol)) + 100
End If
Next
Next
End With
End Sub
Then just call this routine like this:
ResizeGrid MSFlexGrid1, Form1
-
Oct 30th, 2000, 07:54 PM
#5
Thread Starter
Member
Surge,
This seems to do the trick. Although it seems like it only works when the grid control is wide enough to show all the text in the cell. The col width is widened, scroll bars are added (if needed), but if the grid control is not wide enough, you still can't see all the text in the cell containing the most text. It is cut off.
I wonder why?
Chris.
-
Oct 30th, 2000, 08:58 PM
#6
Lively Member
im trying to use a flexigrid control too
but never used one before
here is my code
my SQL 7 database opens up but i dont know how to get the query result to show in my control please help me!!!
thanks john
Code:
Private Sub Command1_Click()
Dim dyna As Recordset
Dim theError As Long
Dim theid As Long
theid = txtCandidateID
SQL = "Select * from candidate where candidateID = " & theid & "'"
On Local Error Resume Next
Set dyna = db.OpenRecordset(SQL, dbOpenDynaset, dbSQLPassThrough + dbSeeChanges)
theError = Err
On Local Error GoTo 0
-
Oct 30th, 2000, 09:11 PM
#7
After having your recordset open, you can do something like this:
Code:
Dim intRow As Integer
Dim intCol As Integer
With MsFlexGrid1
dyna.MoveLast
.Rows = dyna.RecordCount + 1
.Cols = dyna.Fields.Count
dyna.MoveFirst
'Initialize row position
'We have to start with row 1, because row 0 is the header
intRow = 1
Do Until dyna.EOF
For intCol = 0 To dyna.Fields.Count - 1
'take care of headers
If intRow = 1 then
.TextMatrix(0, intCol) = dyna.Fields(intCol).Name
End If
.TextMatrix(intRow, intCol) = dyna(intCol).Value
Next
intRow = intRow + 1
dyna.MoveNext
Loop
End With
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|