email_smdd_here Posted February 24, 2004 Posted February 24, 2004 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? Quote
*Gurus* Derek Stone Posted February 24, 2004 *Gurus* Posted February 24, 2004 Not without overriding the DataGrid's render method. http://www.scrollingdatagrid.com/ Quote Posting Guidelines
Moderators Robby Posted February 24, 2004 Moderators Posted February 24, 2004 You can always place the grid in DIV tags. Quote Visit...Bassic Software
email_smdd_here Posted February 24, 2004 Author Posted February 24, 2004 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? Quote
Moderators Robby Posted February 24, 2004 Moderators Posted February 24, 2004 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> Quote Visit...Bassic Software
email_smdd_here Posted February 24, 2004 Author Posted February 24, 2004 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. Quote
Moderators Robby Posted February 24, 2004 Moderators Posted February 24, 2004 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. Quote Visit...Bassic Software
g_r_a_robinson Posted February 24, 2004 Posted February 24, 2004 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/ Quote
email_smdd_here Posted February 25, 2004 Author Posted February 25, 2004 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? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.