Urgent | Highlight Row in DataView

T

tirath

hi,

I have a DataView which has around 50 items(the page has scrollbars).
there is a search box on top of the page. when user enters an Id, i do
DataView.find("Id"). I get the row index but i need to highlight this
row and set focus on this row. that means my page might have to scroll
down if the id that is searched happens to be the 45th one.

Please help me do this.

Thanks
 
C

Cowboy \(Gregory A. Beamer\)

You can use the row binding event to intercept the row build and color any
color you want, if ther eis a postback. If you have a row click event, you
can pull the id at that time. If you are aiming for complete client side
highlighting, you will have to loop through rows in JavaScript and highlight
that way. It is a bit more involved, but the speed is not bad as you are
working on the client's browser.

I don't have an example off hand, but I remember someone who created a
DataGrid (1.x) that higlighted rows as you scrolled. Very neat stuff. I will
see if I can find the URL.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
 
T

tirath

You can use the row binding event to intercept the row build and color any
color you want, if ther eis a postback. If you have a row click event, you
can pull the id at that time. If you are aiming for complete client side
highlighting, you will have to loop through rows in JavaScript and highlight
that way. It is a bit more involved, but the speed is not bad as you are
working on the client's browser.

I don't have an example off hand, but I remember someone who created a
DataGrid (1.x) that higlighted rows as you scrolled. Very neat stuff. I will
see if I can find the URL.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!








- Show quoted text -

hi Gregory,
Thanks for the reply.
I am not sure how can i capture row binding event in this case?I dont
have any row binding event here because i am not binding the rows
right now. I have a datalist whose source is this DataView. There is a
text box and button on this page above the datalist. When user types
the Id and clicks search, then i do DataView.find and get the
rowindex.I want this row to get highlighted and have the focus.
Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top