In a datagrid I need to lock the header

J

Jennyfer J Barco

Hello again I have a datagrid and I'm showing many records. I need 2 things:

I need that everytime they scroll down, the header stays lock so the user
can see it all the time. I need to scroll only the data and keep the header
stationary. Is this possible?

Second the user has a search bottom and a textbox and when he inserts a
value my program selects the row (using MyGrid.SelectedIndex) that matches
the value the user entered. If the row is at the botton of the datagrid the
user can't see it, has to move down to find it. I need the datagrid to
scroll up to show the selected row in front of the screen because right now
he has to scroll down to find where is the highlighted record.

Thanks in advance
Jennyfer
 
B

bruce barker

there is no easy way to do this.

basically you create 2 html tables. one for the header and one for the data.
the data table should be in a sized div with overflow set. now comes the
tricky parts. you need to keep the column widths the same for the two
tables, so client script will be required to calc these at runtime, and
reset the column widths. if you want horizonal scrolling, you should use a
javascript applet, as doing it client script gets really tricky.

-- bruce (sqlwork.com)
 

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

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top