Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Highlight Selected Row

1,342 views
Skip to first unread message

Ravipal

unread,
Jan 27, 2001, 7:01:41 AM1/27/01
to
I have two datawindows in my window, and I want to highlight the row that
was selected last in the leaving datawindow when the user switches focus to
the other window and vise versa. Which event and functions of the
datawindow should I use for this purpose?
Thanks in advance
Ravi

Dawn Brown Eyes [TeamSybase]

unread,
Jan 28, 2001, 5:58:56 PM1/28/01
to
I am not sure I understand the question.

Selectrow() will highlight the row.

Getrow() will get the last selected row


in the getfocus event of the datawindow use getrow to get the rownumber in
the last datawindow
and use selectrow to highlight that row in the new datawindow.

I usually put code in the rowfocuschanged event. when the row changes, then
row gets highlighted and the row in the other datawindow will be highlighted
also.

--
Dawn Brown Eyes (TeamSybase)

--
Dawn Brown Eyes (TeamSybase)
<Ravipal> wrote in message
news:DA19E09702B09FF300421253852569E1.00421283852569E1@webforums...

Jean-Paul Finne

unread,
Jan 31, 2001, 4:08:09 AM1/31/01
to
1) If you use SetRowFocusIndicator, it stays on when the focus changes
2) If you use SelectRow, you can have only one row selected for your purpose
3) I use a rectangle to show the currentrow, you can adapt it to your need
Change the color in the losefocus event and getfocus event:
dw.modify("rf_rect.brush.color=" + ls_bg_colour )

string controlName = "rf_rect"
if dw.describe(controlName + ".name") <> "!" then return true
string ls_bg_colour ,ls_mod
long ll_width file://width of band
string bg = string(COLOR_FOCUS)

ls_bg_colour = "'" + bg + "~t if(isselected(), " + string(COLOR_SELECTED) +
"," +bg + ")'"

ll_width = getTotalWidth(dw)

ls_mod = "Create Rectangle(band=detail" + &
" x='0'" +&
" y='0'" +&
" height='80~t if(1=1, RowHeight(), 80)'" +&
" width='" + string(ll_width) + "'" +&
" name=" + controlName +&
" visible='1~t if(currentrow() = getrow(), 1, 0)'" +&
" brush.hatch='6'" + &
" brush.color=" + ls_bg_colour +&
" pen.style='0'" +&
" pen.width='5'" +&
" pen.color='" + string(rgb(255,255,255)) + "'" +&
" background.mode='2'" +&
" background.color='0'" +&
")"

string rc
rc = dw.Modify(ls_mod)
dw.SetPosition(controlName, "detail", FALSE)

<Ravipal> wrote in message
news:DA19E09702B09FF300421253852569E1.00421283852569E1@webforums...

Jakub Janda

unread,
Jan 31, 2001, 4:40:33 AM1/31/01
to
> 2) If you use SelectRow, you can have only one row selected for your
purpose

I am sorry? You can select multiple rows with SelectRow() function.

Jakub Janda

Simon Caldwell

unread,
Jan 31, 2001, 5:06:59 AM1/31/01
to
I think it's a distinction between 'you can have only one' (ie if you want
to), and 'you can only have one' (whether you like it or not).

S.

--
Simon Caldwell
Get Real Systems Ltd
Holtby Manor, Stamford Bridge Road, York, YO19 5LL
Tel 01904 481999 Fax 01904 481666
Visit us at www.getrealsystems.com

Specialists in e-Procurement and supply chain technology


"Jakub Janda" <Jakub.Janda@empireDOTcz> wrote in message
news:WtgY9w2...@forums.sybase.com...

Jean-Paul Finne

unread,
Jan 31, 2001, 6:03:44 AM1/31/01
to
I know.

If I understand well, Ravipal wants to show differently the last line
selected.
SelectRow only offers a blue background for all selected lines.

"Jakub Janda" <Jakub.Janda@empireDOTcz> wrote in message
news:WtgY9w2...@forums.sybase.com...

Jean-Paul Finne

unread,
Jan 31, 2001, 6:07:00 AM1/31/01
to
sorry for the english.

"Simon Caldwell" <simonDOTcaldwellATgetrealsystemsDOTcom> wrote in message
news:XEU$vA3iA...@forums.sybase.com...

0 new messages