Hello,
I'm using Infragistics ASP.Net 14.2 WebDataGrid. into VS 2010.
I would like to "anchor" vertically the webdatagrid, according to the height of the "parent" element.
Details : Say I have 200 rows to display ; problem is that the scrollbar scrolls the entire web page, making the page header controls disappear.
What I would want to reproduce is the Windows Forms full anchoring behavior ; the grid is docked and the scrollbar only affectets the grid rows.
Note that the WebDataGrid does already anchors horizontally.
I found some answers on the web, but they seem to address older infragistics controls.
Note that paging data would not solve the problem, because clients can always resize the web page.
Thank you for any tips !
Hello Manuel,
Thank you for contacting Infragistics!
The WebDataGrid doesn’t have a method or property to anchor it on the page. If you want only the grid rows to scroll you have to have the mouse hovered over the grid. If you want the height to size with the page you can set a percentage width. The exception to this is if you are using virtual scrolling then you will require a fixed height.
I would like to precise that the web browser is IE9 ; this might or not be relevant.
Thank you for your answer. I understand these tips, and would like to go further on this one which match precisely my problem :
Mike P"]If you want the height to size with the page you can set a percentage widthheight
Ok, but the percentile height only works if the container height is not defined in percentile : if you put a percentile on the container height, the grid will ignore his own height property. This indeed works for the width of the grid (the grid width moves dynamically according to the dynamic sizing of the web page with the mouse)
For example, consider a aspx page containing a div, and this div containing the grid :
Affecting a percentile in the container should allow the dynamic autosizing of the grid's height, according to the browser window dynamic size.
I know this is a feature request, not a bug. But I think this is a pretty common design, and any trick is welcome ("some" javascript, ...).
Of course we could set a fixed height for all the grids, and that will not be too bad for the project, but the fixed things would seem a bit unfinished. Coming from Windows Forms, I might be over-expectating how a web app should dynamically behave, and I could of course understand that from a seasoned web developper..
Thank you for the update. The reason you are seeing that behavior with the height is the height of the html and form is based on the hard coded contents, you can see the following link for more information.
http://stackoverflow.com/questions/2239045/why-is-100-height-not-100-of-the-browser-height
to resolve this you can add the following style to the page:
html, body, form { height: 100% }
Please let me know if you have any further questions concerning this matter.
Thank you, this is perfect, and the grid now produces the expected "wow" effect ;)
Using a microsoft "Site.css" template, this height attribute was also to be defined into the ".main" and ".page" css classes.
I'm sorry this was a HTML related common issue, thank you for the link.
Have a nice day !