Highlighted
Absent Member.
Absent Member.
371 views

[archive] Highlighting Grid Row

[Migrated content. Thread originally posted on 20 November 2006]

Hello!
Is there any way to highlight a grid row when you click on it by changing the color of the text in that row?

Thanks!!!!:confused:
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Highlighting Grid Row

If you look at the gridctl sample program provided by Acucorp, it'll let you see how its done.

Shaun
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Highlighting Grid Row

Is there any way to do it by clicking any field in a row rather than just the row header?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Highlighting Grid Row

In the grid events (Msg-Begin-Drag, Msg-Goto-Cell, Msg-Goto-Cell-Mouse, Msg-Goto-Cell-Drag and Msg-Begin-Entry), add code like this:-
           MODIFY Your-Grid-Control-Name,
               Y = EVENT-DATA-2,
               ROW-COLOR BRIGHT-WHITE + BCKGRND-RED.
Assuming that Event-Data-2 holds the row number that your user clicked on, which it will for the events mentioned.

Once you've highlighted the row that the user has clicked on, you need to remove highlights from the line they just left. I do it all in one step like this:-
           MODIFY Ss02-Gd-Docket-Lines,
               Y = WS01-DOCKET-LINE + 1,
               ROW-COLOR BLACK + BCKGRND-BRIGHT-WHITE
               Y = EVENT-DATA-2,
               ROW-COLOR BRIGHT-WHITE + BCKGRND-RED,
               CURSOR-Y = EVENT-DATA-2.


Ian
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.