I'm still getting a feel for DataGrids but have noticed that it is possible in a DataGrid form to have say row 3 hilited but an editable field in row 2 focused (see attached screenshot). For the project I am working on the row containing the focused object should always be hilited.
So I'm thinking that the best way to do this is to get the row number that the focused or clicked object is in and then hilite that row. Is this possible or is there an easier way?
Best Regards
Chris
DataGrid Form row hilite
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
DataGrid Form row hilite
- Attachments
-
- DataGrid hilited Rows.png (29.82 KiB) Viewed 3057 times
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: DataGrid Form row hilite
Chris,
You will have to script the hilites yourself if you want to change the hilite as focus moves from a control in one row to a control in another row. In the Data Grid script you could do something like this (completely untested code):
You will have to script the hilites yourself if you want to change the hilite as focus moves from a control in one row to a control in another row. In the Data Grid script you could do something like this (completely untested code):
Code: Select all
on openField
HiliteRowOfFocusedControl
end openField
on focusIn
HiliteRowOfFocusedControl
end focusIn
command HiliteRowOfFocusedControl
## Get row control for field being opened
put the dgDataControl of the target into theControl
if theControl is not empty then
set the dgHilitedIndexes of me to the dgIndex of theControl
end if
end HiliteRowOfFocusedControl
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: DataGrid Form row hilite
Thank you Trevor that works a treat.
Best Regards
Chris
Best Regards
Chris