Page 1 of 1

DataGrid Form row hilite

Posted: Tue Dec 08, 2009 6:46 am
by chriswood
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

Re: DataGrid Form row hilite

Posted: Fri Dec 11, 2009 3:36 pm
by trevordevore
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):

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

Re: DataGrid Form row hilite

Posted: Mon Dec 14, 2009 7:13 am
by chriswood
Thank you Trevor that works a treat.

Best Regards

Chris