Hi all,
We are using WebGrid 8.3 and WARP in a Web application.
The WARP contains the WebGrid. When we set the StationaryMargins = "Header" from the Grid and the Grid contains only one row, there is unexpected space betwwen the Grid header and the first row - the grid looks very horrible.
But if the grid contains more than one row, it looks well.
When we set the StationaryMargins = "None", it also looks well.
Please help me to resolve this issue.
Thanks in advance,
Nguyen Huu Chu
VNetSoftware, LLC
You mention that the grid is inside of a WARP, but you didn't say whether you noticed that made a difference or not. It would be tremendously helpful to know if you get the same appearance when the grid is not inside of the WARP panel.
It sounds like you have a height set on the Grid, but now default rowheight set, which forces the rows of the grid to fill the entire available space. Double check the grid.DisplayLayout.RowHeightDefault property, and be sure it has a value set.
You can also troubleshoot this as a CSS problem using a good DOM explorer like IE Developer Toolbar (which is built into ie 8). By using the DOM explorer you can mouse over a given region on the sceen and see what CSS properties are set on that element. You can also add css properties like height, width, overflow, etc. to see how they affect the appearance.
Lastly, you might want to try using Application Styling, and use one of the 10+ predefined styles available.
Hope this helps,
-Tony
Thanks you, Tony
grid.DisplayLayout.RowHeightDefault was set to 20px
I think the issue come from the height of the Grid when it is inside the WARP. When I fix the Grid's height as 100px OR reduce the Grid's hight =80%, the extral space go away.
It work well when it was out-side the WARP.
Regards,
I can confirm this bug. I'm using NAS 8.2.20082.2038.
The problem occurs when the grid has stationary margins=Header and there is only 1 record bound to the grid. I haven't noticed this in prior versions of NAS (EG: 8.1). Load the grid with 0 or more than 1 records and the formatting works correctly, otherwise the header appears midway within the grid and NO record is displayed.
Partial rendering with an UpdatePanel or WARP panel can be troublesome sometimes, when styles are created dynamically. There are 2 ways to style the grid, one through the use of the CSSClass properties or Application Styling, and the second way is to set styles through the properties of the grid. When using an UpdatePanel or WARP panel, I always recommend styling through CSS and external stylesheets as opposed to the object level "style" properties on the grid. Browsers are much more stable when dealing with an external stylesheet, than when parsing in dynamic inline style tags through an AJAX call.
Try enabling Application Styling and setting your styles through CSS - I expect the rendering glitch will disappear.