By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,837 Members | 1,813 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,837 IT Pros & Developers. It's quick & easy.

In a datagrid I need to lock the header

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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)
"Jennyfer J Barco" <pd*****@nospam.wdsinc.com> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.