|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am using datagrid to populate the data in the table. I want to change the color of a particular row in the datagrid depending on some information in the row. Can somebody help me to do this.
|
|
#2
|
||||
|
||||
|
what information are you wanting to base it on
__________________
Fisherman "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein |
|
#3
|
||||
|
||||
|
what information are you wanting to base it on
|
|
#4
|
|||
|
|||
|
Hi,
I want to know how to change the color of a particular row depending on the information in that row. Suppose if a row contains information about 'cancelled programe' I want it to be displayed in red. Thanks in advance. |
|
#5
|
||||
|
||||
|
ok, so.. once you have loaded the datagrid, you want to step through the grid one record at a time and change the colors? Let me ask you this, is the datagrid going to be a direct reflection of the recordset? In other words, are the datagrids records going to be in the same order as the recordset?
|
|
#6
|
|||
|
|||
|
Now the datagrids are just the direct reflection of the recordset
|
|
#7
|
||||
|
||||
|
Ok.. here's the deal. That functionality is available in VB.NET (sorry I beat around the bush, but I've been working with .NET a lot lately), but I have not been able to find it in VB6. try using a table and loading the data manually instead of using a DataGrid.
|
|
#8
|
|||
|
|||
|
Thank you for your response, May be you are right.
|
|
#9
|
|||
|
|||
|
this is the code is used to check whether the numbers were good or bad (within spec or not)
i did fill the grid manually -> as in query , recordset, get every single value, values in array, array in grid. its also necessary to use flexgrid and not datagrid (don't really remember why, but i know it is ^^) Public Function CompareGridToSpecs(gridname As Object) For i = 1 To gridname.Rows - 1 For j = GetNumAttr(CONTENT_FILE) + 3 To gridname.Cols - 1 gridname.Row = i gridname.col = j If Not WithinSpec(val(gridname.Text), j) And gridname.Text <> "" Then gridname.CellBackColor = vbRed gridname.CellForeColor = vbYellow Else gridname.CellBackColor = vbWhite gridname.CellForeColor = vbBlack End If Next j Next i End Function |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > DataGrid in VB6 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|