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

MSHFlexGrid Help

Status
Not open for further replies.

ChewDoggie

Programmer
Joined
Mar 14, 2005
Messages
604
Location
US
G'morning all!

THis is my first attempt to utilize the MSHFlexGrid and am confused about what's occurring with it.

I have bound a recordset to the control via a 'Set' statement. THe recordset contains 5 columns, as does the flexgrid. I want to hide 3 of the five columns from the user. With previous grids, I'd just set the columns width property to zero and that'd hide it. But that doesn't work for this control. THe flexgrid is displaying the columns I want hidden.

Can someone share with me how to accomplish this? Here's my code:

Set rsLineUp = New ADODB.Recordset
rsLineUp.CursorLocation = adUseClient
sql = "select racerid, pos, classid, comp, left(fname, 1) & '. ' & lname as fullname from vracergrid "
sql = sql & " where runclassid =" & runclassid & " and gridtype = '" & RaceType & "'"
sql = sql & " and eventid =" & entId & " and gridnum = " & racenum & ""
sql = sql & " order by pos"
rsLineUp.Open sql, cn, adOpenKeyset, adLockOptimistic
rsLineUp.ActiveConnection = Nothing
flxResultGrid.Rows = rsLineUp.RecordCount + 1
Set flxResultGrid.DataSource = rsLineUp
With flxResultGrid
.Width = 3500

.ColWidth(0) = 0 ' racerid
.ColWidth(1) = 0 ' pos
.ColWidth(2) = 0 ' classid
.ColWidth(3) = 800 ' comp
.ColWidth(4) = 2200 ' fullname

.ColAlignmentHeader(3) = 4 ' center alignment of header
.ColAlignmentHeader(4) = 4 ' center alignment of header

.ColAlignment(3) = 4 ' center alignment of data
.ColAlignment(4) = 4 ' center alignment of data

.TextMatrix(0, 3) = "Comp No."
.TextMatrix(0, 4) = "Racer Name"
.Row = 1
.Col = 1

.CellBackColor = &HC0FFFF 'lt. yellow
End With

Thanks!

ciao for niao!

AMACycle

American Motorcyclist Association
 
Never mind. I reverted back to MSFlexGrid and manually loaded the grid.


ciao for niao!

AMACycle

American Motorcyclist Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top