473,480 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Limit size of datagrid

not sure if I should post this in the web controls newsgroup but just
wondering if there is a way to limit the size of a datagrid and instead of
cutting dat off the user will have a scroll down bar as is done in some
windows applications.
thanks.
--
Paul G
Software engineer.
Nov 18 '05 #1
6 1996
One way is to place the datagrid in a scrolling div.

<div style="OVERFLOW: auto; HEIGHT: 100px; WIDTH: 400px;">
<asp:DataGrid id="dgMyGrid" Width="380px" runat="server" CellPadding="0">
</asp:DataGrid>
</div>

Hope this helps,

Joel Cade, MCSD
Fig Tree Solutions, LLC
http://www.figtreesolutions.com
"Paul" wrote:
not sure if I should post this in the web controls newsgroup but just
wondering if there is a way to limit the size of a datagrid and instead of
cutting dat off the user will have a scroll down bar as is done in some
windows applications.
thanks.
--
Paul G
Software engineer.

Nov 18 '05 #2
Hi Joel thanks for the information. This seems to be working as I have
<div style="OVERFLOW: auto; HEIGHT: 100px; WIDTH: 900px; POSITION: 100,200;">
datagrid
div end tag,
except that I am not able to position it, not sure if I am using the
POSITION correctly but it is currently at the top left section of the form.
Also the user has to scroll down just to see the grid but I think I can fix
this by reducing the HEIGHT of the scrolling div.
Thanks Paul.
"Joel Cade" wrote:
One way is to place the datagrid in a scrolling div.

<div style="OVERFLOW: auto; HEIGHT: 100px; WIDTH: 400px;">
<asp:DataGrid id="dgMyGrid" Width="380px" runat="server" CellPadding="0">
</asp:DataGrid>
</div>

Hope this helps,

Joel Cade, MCSD
Fig Tree Solutions, LLC
http://www.figtreesolutions.com
"Paul" wrote:
not sure if I should post this in the web controls newsgroup but just
wondering if there is a way to limit the size of a datagrid and instead of
cutting dat off the user will have a scroll down bar as is done in some
windows applications.
thanks.
--
Paul G
Software engineer.

Nov 18 '05 #3
Try using TOP and LEFT instead of POSITION

Cheers!

Joel

"Paul" wrote:
Hi Joel thanks for the information. This seems to be working as I have
<div style="OVERFLOW: auto; HEIGHT: 100px; WIDTH: 900px; POSITION: 100,200;">
datagrid
div end tag,
except that I am not able to position it, not sure if I am using the
POSITION correctly but it is currently at the top left section of the form.
Also the user has to scroll down just to see the grid but I think I can fix
this by reducing the HEIGHT of the scrolling div.
Thanks Paul.
"Joel Cade" wrote:
One way is to place the datagrid in a scrolling div.

<div style="OVERFLOW: auto; HEIGHT: 100px; WIDTH: 400px;">
<asp:DataGrid id="dgMyGrid" Width="380px" runat="server" CellPadding="0">
</asp:DataGrid>
</div>

Hope this helps,

Joel Cade, MCSD
Fig Tree Solutions, LLC
http://www.figtreesolutions.com
"Paul" wrote:
not sure if I should post this in the web controls newsgroup but just
wondering if there is a way to limit the size of a datagrid and instead of
cutting dat off the user will have a scroll down bar as is done in some
windows applications.
thanks.
--
Paul G
Software engineer.

Nov 18 '05 #4
Paul wrote:
not sure if I should post this in the web controls newsgroup but just
wondering if there is a way to limit the size of a datagrid and instead of
cutting dat off the user will have a scroll down bar as is done in some
windows applications.


In addition to Joel's solution, you might want to also check out this FAQ:
http://datawebcontrols.com/faqs/Cust...edHeader.shtml

It shows how to create a scrollable DataGrid with fixed headers.

Happy Programming!

--

Scott Mitchell
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
Nov 18 '05 #5
ok thanks for the additional information.

"Scott Mitchell [MVP]" wrote:
Paul wrote:
not sure if I should post this in the web controls newsgroup but just
wondering if there is a way to limit the size of a datagrid and instead of
cutting dat off the user will have a scroll down bar as is done in some
windows applications.


In addition to Joel's solution, you might want to also check out this FAQ:
http://datawebcontrols.com/faqs/Cust...edHeader.shtml

It shows how to create a scrollable DataGrid with fixed headers.

Happy Programming!

--

Scott Mitchell
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!

Nov 18 '05 #6
ok thanks, ended up using the following, with a border around it.
<div style="BORDER-RIGHT: navy 2px solid; PADDING-RIGHT: 1px; BORDER-TOP:
navy 2px solid; PADDING-LEFT: 1px; LEFT: 0px; PADDING-BOTTOM: 1px; OVERFLOW:
auto; BORDER-LEFT: navy 2px solid; WIDTH: 850px; PADDING-TOP: 1px;
BORDER-BOTTOM: navy 2px solid; POSITION: relative; TOP: 204px; HEIGHT: 110px">

"Joel Cade" wrote:
Try using TOP and LEFT instead of POSITION

Cheers!

Joel

"Paul" wrote:
Hi Joel thanks for the information. This seems to be working as I have
<div style="OVERFLOW: auto; HEIGHT: 100px; WIDTH: 900px; POSITION: 100,200;">
datagrid
div end tag,
except that I am not able to position it, not sure if I am using the
POSITION correctly but it is currently at the top left section of the form.
Also the user has to scroll down just to see the grid but I think I can fix
this by reducing the HEIGHT of the scrolling div.
Thanks Paul.
"Joel Cade" wrote:
One way is to place the datagrid in a scrolling div.

<div style="OVERFLOW: auto; HEIGHT: 100px; WIDTH: 400px;">
<asp:DataGrid id="dgMyGrid" Width="380px" runat="server" CellPadding="0">
</asp:DataGrid>
</div>

Hope this helps,

Joel Cade, MCSD
Fig Tree Solutions, LLC
http://www.figtreesolutions.com
"Paul" wrote:

> not sure if I should post this in the web controls newsgroup but just
> wondering if there is a way to limit the size of a datagrid and instead of
> cutting dat off the user will have a scroll down bar as is done in some
> windows applications.
> thanks.
> --
> Paul G
> Software engineer.

Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1995
by: Randell D. | last post by:
Folks, Sorry for the cross post into multiple newsgroups on this, but html forms processing is supported across all three groups so I was hoping someone might know. I did a check with Google...
7
1780
by: DraguVaso | last post by:
Hi, I have a Datagrid, and I want to limit the Lenght of the text in a certain column to a certain number of characters (for exemple 10). What I want is that, when the user is typing in the...
2
6021
by: steve | last post by:
I am setting up a huge database in mysql, and I get the above error in Linux. I believe it is related to the size of one of my tables, which is 4,294,966,772 bytes in size. Can someone help. How...
3
3329
by: Rakesh | last post by:
Hi, Is there any limit to the number of rows a datagrid can display? Thanks, Rakesh
10
3776
by: VM | last post by:
How can I limit the use of the PC's virtual memory? I'm running a process that basically takes a txt file and loads it to a datatable. The problem is that the file is over 400,000 lines long (77...
4
3474
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
6
6472
by: Aaron Smith | last post by:
Is there a way to put a limit on the text size of a datagrid column? Thanks, Aaron -- --- Aaron Smith Remove -1- to E-Mail me. Spam Sucks.
5
3707
by: Jefferis NoSpamme | last post by:
Hi all, I'm trying to limit the file size of an image submission and I keep running into various problems. I've got most of it working, but I'm stumped and I have a basic question as to WHY this...
2
16216
by: Jeff | last post by:
I have a Asp.Net 1.1 application of which I have a very large datagrid on one of my pages. I am populating the datagrid by loading a xml file that is being stored in viewstate. After I have the...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7044
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7084
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6739
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6929
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
181
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.