Thanks. I'm glad you like it.
If by highlight the selected row you mean colour it, then the following shows one way.
Code: Select all
Procedure.l MyCellCallBack(egrid, uMsg, *cellinfo.egridCellInfo)
Protected result
Select uMsg
Case #egrid_SelectCell
;Here we arrange for the selected row to be coloured.
;This requires a complete redraw of the egrid.
;The actual colouring has to be notified in the #egrid_FormatCell message below.
result=#True
RedrawWindow_(GadgetID(1), 0, 0, #RDW_INTERNALPAINT|#RDW_ERASE|#RDW_INVALIDATE)
Case #egrid_LosingFocus
;As part of colouring the selected row, we must arrange to clear these
;colours whenever the selection box is removed.
;The actual colouring has to be notified in the #egrid_FormatCell message below.
result=#True
RedrawWindow_(GadgetID(1), 0, 0, #RDW_INTERNALPAINT|#RDW_ERASE|#RDW_INVALIDATE)
Case #egrid_FormatCell
If *cellinfo\row<>-1 And *cellinfo\row=egrid_SelectedRow(1)
*cellinfo\backcolour = $A5F4F9
EndIf
Default
result = #True ;This accounts for all messages we have decided not to process.
EndSelect
ProcedureReturn result
EndProcedure
;******************************************************************************************
;*************************************WINDOW + GADGET LIST*********************************
If OpenWindow(0,0,0,640,300,"egrid - colour selected row.",#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_Maximize|#PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
;******************************************************************************************
;********************************************EGRID*****************************************
;Create an egrid with resizable columns.
egrid_CreateGrid(1, WindowWidth(0)/4, WindowHeight(0)/8, WindowWidth(0)/2, WindowHeight(0)/2,26,0, #egrid_ResizeColumnsTrue|#egrid_MultiLineText)
;******************************************************************************************
egrid_CreateCellCallback(1, @MyCellCallBack())
egrid_SetHeaderHeight(1, 26)
egrid_SetOptions(1, -1, #Black, 2, -1) ; gadgetnum, header border colour, selection border colour, selection border width, gridline colour
;***************************************ADD COLUMNS AND ROWS TO EGRID**********************************
egrid_AddColumn(1,0,"",60)
For b=1 To 4 ;50 columns.
egrid_AddColumn(1,b,"Col " + Str(b-1),60)
Next
For b=0 To 99 ; Add 100 rows.
egrid_AddRow(1,-1)
Next
;*****************************************EVENT LOOP***************************************
Repeat
EventID = WaitWindowEvent()
Select EventID
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
Until EventID = #PB_Event_CloseWindow
EndIf
End

I may look like a mule, but I'm not a complete ass.