Last post Apr 26, 2005 12:04 PM by PScarlett
Apr 24, 2005 01:19 PM|gregfig|LINK
Okay, I am going to restate this, because, after reading the last post I put up, I wasn't very clear (not that I'll be any more clear this time! [:D]).
I've tried several companies custom webgrids to no avail, then decided to use VS.NET's datagrid only to find the same problem.
If you have a datagrid with columns that extend beyond the window size, the datagrid expands out to the right to accomodate all the fields, instead of staying within the width of the browser and activating a horizonal scroll
It's really annoying. Can someone help? I suspect that I'm just having a brain cramp, and the solution is rather simple... but alas, I can not find it. I can't believe no one has ever put a datagrid in a custom module.
I'd appreciate any help, from anyone.
Apr 24, 2005 01:49 PM|mzns1|LINK
You need to wrap your datagrid with a DIV as shown below. Google the following and you'll get 100's of hits showing code and examples: "asp.net datagrid scrollbars overflow"
<DIV style="OVERFLOW: auto; WIDTH: 100%; HEIGHT: 100%">
<asp:datagrid id="DataGrid1" runat="server" Width="100%"</asp:datagrid>
Apr 24, 2005 04:03 PM|gregfig|LINK
Thank you very much for the reply. I've tried as you suggested, and as the many google hits also suggested (again, thanks for the g-search).
This work wonderfully in a Standard VS.NET app using a webform, as does a datagrid. However, as soon as I put it/them in a user control for a module, all bets are off. No matter what I seem to do, the grid will expand out to
the length of the entire grid.
Any other suggestions? This is really strange, and I'm not sure whether or not it has to do with it being a web user control.
Apr 24, 2005 04:43 PM|mzns1|LINK
Put a table in your module and the grid inside the table.
The table can be set to 100% width & height.
Play with it a bit and you see how to set it up...
Apr 24, 2005 06:09 PM|gregfig|LINK
Okay, get this...
Nothing I've tried seems to work... however...
I installed Intersoft's Webgrid 3.5, and it has properties built into it to allow sizing based on the browser window. It does EXACTLY what I want it to do... BUT...
Even though the grid shrinks and expands properly with the web browser window, the DNN container (and this is true of ALL the containers I've tried), still expands to the width of what the grid WOULD be if it wasn't resizing
to the browser window.
This, I think is part of the problem I've been having. DNN is reading some property, somewhere to determine how big the container needs to be, and it's either the wrong property, or the property is not being set properly. ([:S])
This wouldn't be so much of a problem, but it causes the header and footer of the DNN skin to be as long as the containers width, meaning the user would have to scroll an unreasonable amount to the right, to see any options on
the right side of the page.
(I need a drink! [:)])
Apr 25, 2005 07:58 PM|PScarlett|LINK
While the <div ...> does not help as you noted, I tried the following
<asp:panel style="OVERFLOW: auto" width="800px" height="1000px" runat="server"> ... </asp:panel>
and this does limit the width and height with scrollbars as defined by the absolute values.
An improvement. [Y]
Apr 25, 2005 10:24 PM|gregfig|LINK
[Y] Alright! Now we are making some progress!!!
This does work, with fixed widths and heights as you demonstrated. So I guess, worst case, I can use a fixed width skin with this. HOWEVER, I'm not giving up just yet. I like to be able to give my users as much space as their
display is capable of. So if we can nip this puppy in the bud, I'd be in seventh heaven.
I find two things odd...
Let me express my thanks to those who have responded, and those who may yet respond!! That's the kind of cooperation that makes these forums so great!!! (Ok, slober session is done! [:P])
Apr 26, 2005 12:04 PM|PScarlett|LINK
Since the <asp:panel> generates a <div> section, i took a guess that it may support what you want. Any does if you know the size of the page.
However, in my googling I did discover that the <asp:panel> does support scrollbars under ASP.NET 2.0. So help is on the way.