8/27/2025 7:28:51 PM
|
|
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.
|
|
|
|
Highlight datagrid row based on textbox value
Posted: 15 Dec 08 10:42 AM
|
Hi all.
I have a textbox where the end user enters an item. The textbox use the OnChange event to populate a combobox, this combo box lists all the contracts the item appears on. Once the user selects the contract the combo box OnChange event populates a datagrid.
The datagrid lists all of the items (including the one entered in the textbox) that are associated with the contract chosen in the combo box.
How can I get the datagrid to highlight the row that lists the item entered in the textbox by the end user?
Thank you in advance! |
|
|
|
Re: Highlight datagrid row based on textbox value
Posted: 18 Dec 08 10:21 AM
|
You can use the onCustomDrawCell event for this. I found another function on here called GetColumnIntexByField Name which I use for this as well.
Here's a sample. vItem holds the value of the Column for the Item associated to the contract
Sub grdContractCustomDrawCell(Sender, ByRef Node, ByRef Column, IsSelected, IsFocused, ByRef Text, ByRef Color, ByRef Alignment, ByRef Font, ByRef FontColor) 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 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!
|
|
|
|
|
|
|
|