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

Anyone familiar with TrueDBGrid 8 ?

Status
Not open for further replies.

Tailgun

Technical User
Mar 30, 2002
417
US
Components One TrueDBGrid 8 question.

I need to somehow go thru all the rows in the grid and if any row containing certain 2 columns in that row that are = I need to change the background and disable another column in that same row.

So far with all the other requirements this grid seems to do what I need.

Hope someone can help.

Or is there another 3rd party grid that would be better for this?

Thanks
 
You could try using the msflexi grid. There is alot more help out there for this type of grid than most others. Try search this forum for that grid, and then see if it is possible to do what you want with it.

Good luck

BB
 
Heres code to get you started, though its for TDBGrid 7.0, don't know how diferent 8 is. This will allow you to change the bkgrnd colors on rows which have 2 specific columns equal.

Dim rsClone As ADODB.Recordset
Dim styHighlight As New TrueOleDBGrid70.Style

Private Sub Form_Load()
Set rsClone = rsMyRecordset.Clone()
Set styHighlight = TDBGrid1.Styles.Add("styHighlight")
styHighlight.BackColor = &H000000FF& 'red
TDBGrid1.FetchRowStyle = True
End Sub

Private Sub TDBGrid1_FetchRowStyle(ByVal Split As Integer, Bookmark As Variant, ByVal RowStyle As TrueOleDBGrid70.StyleDisp)
rsClone.Bookmark = Bookmark

If rsClone("column1").Value = rsClone("column2").Value Then
RowStyle = styHighlight
End If

End Sub
 
Thanks alot guitarzan I will give this a try.
Thanks again.
 
Also, ComponentOne offer free support. You can email them with queries.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top