473,804 Members | 3,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

datagird width = 100%

i've added a data grid to an aspx form, & i've noticed that the width of the
grid is fixed.
I want to be able to set the width to fit the entire width of the browser.

Such as done in classic HTML with the table width = 100%

Can this be achieved for a data grid? if so how?
Nov 19 '05 #1
2 1180
A technique I often use is to put a HTML table with on row and cell on the
form, position it where you want, and assign a width of 100%. Then you put
the grid inside that table. Then you set the width of the datagrid to 100%.
It will take up the entire width of the page.

hope this helps,
John

"Logan" wrote:
i've added a data grid to an aspx form, & i've noticed that the width of the
grid is fixed.
I want to be able to set the width to fit the entire width of the browser.

Such as done in classic HTML with the table width = 100%

Can this be achieved for a data grid? if so how?

Nov 19 '05 #2
Or you can put <TABLE width='100%'> tag in the datagrid HeaderTemplate, and
</TABLE> in the datagrid FooterTemplate.
Then you can put <TR> and <TD>s in ItemTemplate.

Hope it helps, Neven
"John Sivilla" <Jo*********@di scussions.micro soft.com> wrote in message
news:FA******** *************** ***********@mic rosoft.com...
A technique I often use is to put a HTML table with on row and cell on the
form, position it where you want, and assign a width of 100%. Then you put
the grid inside that table. Then you set the width of the datagrid to 100%. It will take up the entire width of the page.

hope this helps,
John

"Logan" wrote:
i've added a data grid to an aspx form, & i've noticed that the width of the grid is fixed.
I want to be able to set the width to fit the entire width of the browser.
Such as done in classic HTML with the table width = 100%

Can this be achieved for a data grid? if so how?

Nov 19 '05 #3

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

Similar topics

2
3180
by: Alex Shi | last post by:
In php, is there a way obtain the width of a charactor of a certain font? Alex -- ================================================== Cell Phone Batteries at 30-50%+ off retail prices! http://www.pocellular.com ==================================================
7
12231
by: Graham J | last post by:
Apologies for the partial post that mysteriously escaped as I was composing. I shall try again. For many years I have been happily and successfully coding tables such that the WIDTH specified in a TD is the complete column width including any CELLPADDING. For example for a 400 pixel wide table with four 100 pixel wide columns and 10 pixel cellpadding... <TABLE WIDTH="400" BORDER="0" CELLSPACING="0" CELLPADDING="10">
0
1001
by: timon | last post by:
I have create a Datagird in the window form. How can I set the column name in the datagird?
3
1127
by: alex | last post by:
Hi, can anyone point me to a link whith a sample on how to auto fit the datagrid? i need to 1: each row should occupy as much space as needed, the last row should fill the remaining space (or the remaining space should be equally distributed among all colunns). 2: if grid width does not fit summ of actual column widths send add scrollbar.
50
6086
by: Shadow Lynx | last post by:
Consider this simple HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 STRICT//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Strict kills my widths!</title> </head> <body> <table style="width:400px; table-layout:fixed;">
6
28103
by: Hacking Bear | last post by:
Hi, I still don't quite fully understand how to handle mixing border/margin pixel width with percentage width. In the example below, I want to place side-by-side two DIV boxes inside a box. 1. Each box takes up 50% of the parent. 2. One of the box has a border width of 1px.
3
2928
by: McKirahan | last post by:
I have a Web page that uses some JavaScript and CSS. I have specified a three column table with a fixed-width left and right side; the center colum expands to fill the page. Within this portion of the table I have another table that specifies "display:none" to hide it. When the page loads, if JavaScript is enabled then it will change to "display:block". However, the problem under Firefox is that the width of
11
5415
by: yawnmoth | last post by:
How do you get both of these div's to have a 100% width? (1): <div style="float: left; background: black; color: white">Hello, world! </div> <div style="clear: both; background: blue; color: white">Hello, world! </div> You could set the width inside the floated div to 100% but if you do that and if you have a floated fixed width div, the 100% width div will appear on a new line, as demonstrated (2):
1
10846
by: psion | last post by:
Hi, We have a gridview on a webpage, which we would like to be 100% of the table cell in which it is placed. When we specify the width to be 100%, this has no effect, but only if we specify a pixel number, i.e. 800, will the gridview be 800 px wide. Here is an example: http://www.valuetronics.com/Results.aspx?keywords=8050&x=0&y=0 And this may be related, but this page
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10558
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10318
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10069
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9130
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2975
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.