Highlighting a Row in a Datagrid Based on an Item Entered in a Textbox in SalesLogix

Question: In our SalesLogix system users enter an item into a textbox.  This
textbox uses an OnChange event to populate a combo box, and the combo
box lists all contracts on which the entered item appears.  After the
user chooses the desired contract, the combo box OnChange event
populates a datagrid.  This datagrid lists all items, including the item
entered into the textbox, that are associated with the contract chosen
in the combo box.  I would like to highlight the row in the datagrid
that lists the original item that was entered in the textbox by the end
user, any idea how I can do this?

Answer: You can use the onCustomDrawCell event and another function called GetColumnIntexByField Name.  Here’s a sample:

vItem holds the value of the Column for the Item associated to the contract

grdContractCustomDrawCell(Sender, ByRef Node, ByRef Column, IsSelected,
IsFocused, ByRef Text, ByRef Color, ByRef Alignment, ByRef Font, ByRef
Dim vItem
vtItem = grdContract.Nodes(Node.Index).Values(GetColumnIndexByFieldName(grdContract, “Item”))

If vItem = textbox.text Then
Color = “&HE2E2E2”

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
GetColumnIndexByFieldName = lColumnIndex

End Function



Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!