7/8/2025 6:32:39 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
Color change on history grid?
Posted: 04 Feb 10 2:15 PM
|
Hello - We want to change the row color in the history grid for each row equal to a value in the history.description field. We have tried the examples posted in the forum, but they don't work. No errors, just nothing happens. We are using SLX 7.2. thanks! |
|
|
| |
|
Re: Color change on history grid?
Posted: 05 Feb 10 10:40 AM
|
Thanks for replying. We are using the OnCustomDrawCell event, and the script is below.
Sub grdHistoryCustomDrawCell(Sender, ByRef Node, ByRef Column, IsSelected, IsFocused, ByRef Text, ByRef Color, ByRef Alignment, ByRef Font, ByRef FontColor) Dim sFieldName Dim vStatus Dim lColumnIndex
sFieldName = UCase (Description) ' Field you want to look for
Select Case sFieldName Case "A1.DESCRIPTION" ' ALIAS name of the column in QB
lColumnIndex = GetColumnIndexByFieldName (grdHistory,"A1.DESCRIPTION" ) ' Used so that grid can be sorted/grouped vStatus = Node.Values ( lColumnIndex ) ' Gets the actual value End Select
If Not IsNull ( vStatus ) Then ' Ensure you check for Nulls
Select Case vStatus Case "G4-Escalation" FontColor = wclCrimson End Select End If
End Sub
Function GetColumnIndexByFieldName ( ByRef Grid, ByVal FieldName ) Dim i Dim lColumnIndex
lColumnIndex = -1 For i = 0 To Grid.Columns.Count - 1 If UCase ( Grid.Columns(i).FieldName ) = UCase ( FieldName ) Then lColumnIndex = i Exit For End If Next GetColumnIndexByFieldName = lColumnIndex End Function |
|
|
| |
|
Re: Color change on history grid? -- no problem  
Posted: 12 Feb 10 5:50 AM
|
Hello Jill,
at the moment i try the same things, colorize some cells in a datagrid.... )
please try this modification in your code:
sFieldName = UCase (Column.FieldName) ' Field you want to look for
and don't forget to check for the right values in the SELECT CASE Statement, e.g. if you want to check the TICKET.STATUSCODE for values like "open", "in process" etc., you have actually check for those values like "k6UJ9A000039", "k6UJ9A000038" ...... ))))
have a nice day
Marcus
|
|
|
|
Re: Color change on history grid? -- no problem  
Posted: 17 Feb 10 10:21 AM
|
Here is what we got to work (in CustomDrawCell)
Sub grdHistoryCustomDrawCell(Sender, ByRef Node, ByRef Column, IsSelected, IsFocused, ByRef Text, ByRef Color, ByRef Alignment, ByRef Font, ByRef FontColor)
Dim sFieldName Dim vStatus Dim lColumnIndex
sFieldName = UCase ( Column.FieldName ) ' Field you want to look for
Select Case sFieldName Case "CATEGORY" ' ALIAS name of the column in QB lColumnIndex = GetColumnIndexByFieldName ( grdHistory,"CATEGORY" ) ' Used so that grid can be sorted/grouped vStatus = Node.Values ( lColumnIndex ) ' Gets the actual value End Select
If Not IsNull ( vStatus ) Then ' Ensure you check for Nulls
Select Case vStatus Case "Escalation" Color = &H000000FF Font.Bold = True End Select End If
End Sub
Function GetColumnIndexByFieldName ( ByRef Grid, ByVal FieldName ) Dim i Dim lColumnIndex
lColumnIndex = -1 For i = 0 To Grid.Columns.Count - 1 If UCase ( Grid.Columns(i).FieldName ) = UCase ( FieldName ) Then lColumnIndex = i Exit For End If Next GetColumnIndexByFieldName = lColumnIndex End Function |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|