473,320 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How set the size (width) of field in Datagrid

How to set the size of a field in DataGrid?

Right now the size is automatically set and determined by the size of the
colunm name.

Thanks

David
Nov 19 '05 #1
3 1615
david wrote:
How to set the size of a field in DataGrid?

Right now the size is automatically set and determined by the size of
the colunm name.

If using Visual Studio, just right-click the grid and fire up the Propery
Builder, using the Format tab to modify the Column widths.

Otherwise, add a HeaderStyle tag to the html:

<asp:BoundColumn ... >
<HeaderStyle Width="150px"></HeaderStyle>
</asp:BoundColumn>

HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Nov 19 '05 #2
This may be what you are looking for

<Columns>
<asp:BoundColumn DataField="EMPLOYEE_NUMBER"
SortExpression="EMPLOYEE_NUMBER" HeaderText=" Employee ID ">
<HeaderStyle HorizontalAlign="Center" Width="250px"
VerticalAlign="Middle"></HeaderStyle>
</asp:BoundColumn>
</Columns>


"david" wrote:
How to set the size of a field in DataGrid?

Right now the size is automatically set and determined by the size of the
colunm name.

Thanks

David

Nov 19 '05 #3
In addition to the other answers just note, that the browser considers your
column width instructions only as recommendations. To force the browser to
listen to you use css rule table-layout:fixed.

Eliyahu

"david" <da***@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...
How to set the size of a field in DataGrid?

Right now the size is automatically set and determined by the size of the
colunm name.

Thanks

David

Nov 19 '05 #4

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

Similar topics

2
by: Dmitri Shvetsov | last post by:
Hi, I'm using these strings around DataGrid <div ID="div1" style="LEFT: 4px; OVERFLOW: auto; WIDTH: 100%; POSITION: absolute; TOP: 248px; HEIGHT: 300px"> ....datagrid... </div>
1
by: Pavel Gusak | last post by:
Hello. I've found DataGrid built-in edit functionality useless. My DataGrid has 9 columns, and is shown just nice until I press 'Edit' on a row. ASP.NET creates 9 TextBoxes, all the same very big...
1
by: Drew | last post by:
Hey, thanks in advance for helping me out with my problem: I have a datagrid which is embedded in another datagrid. The datagrid is filled directly by a dataset generated from a sql query. So...
6
by: Paul | last post by:
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...
5
by: Pohihihi | last post by:
Why can't the following work when it has a set property defined? this.textBox1.Size.Width = 25; I get error Cannot modify the return value of 'System.Windows.Forms.Control.Size' because it is...
2
by: Dominique | last post by:
Hello, Im want to fix the width of a dashboard. I have a field which has a field (in this dashboard on the left part of my screen) which could be long and make the right side of the screen out...
6
by: marktxx | last post by:
Although the C90 standard only mentions the use of 'signed int' and 'unsigned int' for bit-fields (use 'int' at your own risk) and C99 adds _Bool. It seems that most compilers create the size of...
3
by: remya1000 | last post by:
I’m using Vb.net application program. I created a datagrid having text field and checkbox fields. Everything is displaying correctly. I have 9 Columns and each columns are equally separated. In...
6
by: Marcolino | last post by:
Hi all, I have a simple problem but I don't know which is the best way to solve it. I need to savo into a table into access DB the location and the size of a form. Is there a way to save...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.