Sorry Mark. Not sure why it doesn't work for you. I call set the dgHilitedLine of group "myDatagrid" to 1 all the time and it does just what you would expect. The only reason to send selectionChanged is if you are trapping for it in the datagrid script, and want to execute some code afterwards. I do not send mouseUp, there's no point, unless you have a mouseUp handler in your datagrid script you want to execute.
Bob On Oct 3, 2012, at 9:29 AM, Mark Stuart wrote: > Thanx Peter and Bob for the suggestions. > > LC: 4.6.4 > > I tried all suggestions but unfortunately, they're not working. > dgHilitedIndex sets the line to the added sequence line, which in my case is > the last line because the DataGrid is sorted descending order. The most > recent record is at the top of the DataGrid. > > Both dgLine and dgHilitedLine select the first line in the DataGrid, which > is the desired effect. > Here's what I tried: > set the dgLine of grp "DataGrid" to 1 > send "mouseUp" to grp "DataGrid" > dispatch "selectionChanged" to grp "DataGrid" > and > set the dgLine of grp "DataGrid" to 1 > dispatch "selectionChanged" to grp "DataGrid" > --send "mouseUp" to grp "DataGrid" > > Both scenarios the DataGrid selectionChanged parameter: HilitedIndex had no > value. > > If you all have any other suggestions, they'll be very much welcomed. > > Regards, > Mark Stuart > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode