1 Attachment(s)
Change a FlexGrid Row Back Color
Dear Friends,
I have developed a letter management system for my office. And I have installed into 10 systems. In that 2 persons are administrator and remaining 8 persons are section peoples. They are authorise person to send comments to section.
Initially if a letter came, corresponding section add letter details in s/w. And When administrator see that, if he wish to ask any query or comments from section, he may update that record using letter ID. Now they wish to seperate (set Color) for a particular letter which they put comments or queries.
Then section people came to know that administrator asking query for that particular letter.
I am enclosing herewith a screenshot for your kind perusal. This screen is displaying for both section and administrator.
If administrator update any one letter, that letter should be shown seperately in grid by its color (Row BackColor). The same grid showing by section also. So its easy for follow up. For that I need idea from your end and how to set a backcolor for a particular row. After updation from section, it must change to normal.
I hope that you can understand my needs.
Thanks in advance.
Yours
GUNA
Re: Change a FlexGrid Row Back Color
If I remember correctly you use code to select the cells in the row you want to change and then set the selection backcolor. I did this a while back but it is fuzzy now. I had a customer that wanted a timer on how long it took to fill orders and for ones that were taking longer than thier target the row would turn red and the text would flash. Wasn't that hard to do once I found the correct methods.
Re: Change a FlexGrid Row Back Color
As mentioned by DataMiser, you can change the background color of a cell and the row. If you want to change all the cells of a particular row, you have to loop through all the columns.
Below code may take you in the right direction.
Code:
Private Sub SetBackColor(FlexGrid As MSHFlexGrid, RowNo As Integer, BkColor As ColorConstants)
Dim ColCount As Integer
With FlexGrid
If RowNo >= .Rows Then
MsgBox "Invalid RowNo"
End If
.Row = RowNo
For ColCount = .FixedCols To .Cols - 1
.Col = ColCount
.CellBackColor = BkColor
Next
End With
End Sub
Good Luck
Re: Change a FlexGrid Row Back Color
The method above will work just fine but it will be faster if you select the cells abd then change the color of the selection.
Re: Change a FlexGrid Row Back Color
Quote:
Originally Posted by
DataMiser
The method above will work just fine but it will be faster if you select the cells abd then change the color of the selection.
I Agree DataMiser, the same code can be modified as below:
Code:
Private Sub SetBackColor(FlexGrid As MSHFlexGrid, RowNo As Integer, BkColor As ColorConstants)
With FlexGrid
If RowNo >= .Rows Then
MsgBox "Invalid RowNo"
End If
.FillStyle = flexFillRepeat '<----Without this line it will not work
.Row = RowNo
.Col = .FixedCols
.RowSel = RowNo
.ColSel = .Cols - 1
.CellBackColor = BkColor
End With
End Sub