Connecting Tech Pros Worldwide Forums | Help | Site Map

Urgent | Highlight Row in DataView

tirath
Guest
 
Posts: n/a
#1: Mar 7 '07
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


tirath
Guest
 
Posts: n/a
#2: Mar 7 '07

re: Urgent | Highlight Row in DataView


I am using ASP.Net 2.0


Cowboy \(Gregory A. Beamer\)
Guest
 
Posts: n/a
#3: Mar 7 '07

re: Urgent | Highlight Row in DataView


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!
*********************************************
"tirath" <Tirath.g@hotmail.comwrote in message
news:1173275222.571676.111630@p10g2000cwp.googlegr oups.com...
Quote:
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
>
tirath
Guest
 
Posts: n/a
#4: Mar 7 '07

re: Urgent | Highlight Row in DataView


On Mar 7, 7:21 pm, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@comcast.netNoSpamMwrote:
Quote:
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!
*********************************************"tira th" <Tirat...@hotmail.comwrote in message
>
news:1173275222.571676.111630@p10g2000cwp.googlegr oups.com...
>
>
>
Quote:
hi,
>
Quote:
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.
>
Quote:
Please help me do this.
>
Quote:
Thanks- Hide quoted text -
>
- 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

Closed Thread