DataGrid with Scroll-bar???

email_smdd_here

Newcomer
Joined
Feb 24, 2004
Messages
7
Location
MD, USA
Hey guys,
Ive been developing an application and I have my datagrid inside of a div but now when I scroll the header goes with it. Is there anyway to keep the header at the top and just scroll the data?
 
Well thats disappointing. I read somewhere that this could be achieved in an iframe but I never got any of my coding to work out. I do have another question though. In the application I am designing I design my datagrid to be a certain size and then populate it with information from a SQL database. No problem. Now lets say the query for the desired table only returns 1 or 2 results but I have the table set to be tall enough to fit 10 results. Now the rows stretch in height to fill my datagrids area. Same thing happens with my header fields. Is there anyway to fix this short of hard coding in sizing for each row? IE is there an autosize I'm not seeing, or something to stop the datagrid from stretching the rows?
 
Why is it disappointing?
I wouldn't use an Iframe, prefer to use a div tag...
it works and it's smiple....

<div style="Z-INDEX:101; LEFT:150px; OVERFLOW:auto; WIDTH:772px; POSITION:absolute; TOP:31px; HEIGHT:172px" nowrap>
//Place grid here

</div>
 
A div tag is what I'm using now. The problem is that the header scrolls with the rest of the grid. I heard that the header could be locked by using an iframe but havent gotten it to work.
 
Hmmm, I really should read more carefully :) , I just now realized what you said in your original post... Sorry.

I guess Derek's suggestion is the way to go.
 
I had this problem and found a really neat component on andy smith site that lets you drop either a datagrid or datalist into the 'Scrolling Panel' it works just great. Also it remembers where you left the scroll on postbacks.

heres the link:

http://www.metabuilders.com/
 
email_smdd_here said:
I do have another question though. In the application I am designing I design my datagrid to be a certain size and then populate it with information from a SQL database. No problem. Now lets say the query for the desired table only returns 1 or 2 results but I have the table set to be tall enough to fit 10 rows. Now the rows stretch in height to fill my datagrids area. Same thing happens with my header fields. Is there anyway to fix this? IE is there an autosize I'm not seeing, or something to stop the datagrid from stretching the rows?
 
Back
Top