Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How set the size (width) of field in Datagrid

Reply
Thread Tools

How set the size (width) of field in Datagrid

 
 
=?Utf-8?B?ZGF2aWQ=?=
Guest
Posts: n/a
 
      07-20-2005
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
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      07-20-2005
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.


 
Reply With Quote
 
 
 
 
=?Utf-8?B?U3JlZWppdGggUmFt?=
Guest
Posts: n/a
 
      07-20-2005
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

 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      07-20-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript validation for a not required field, field is onlyrequired if another field has a value jr Javascript 3 07-08-2010 10:33 AM
Preferred Size, Minimum Size, Size Jason Cavett Java 5 05-25-2008 08:32 AM
mega pixels, file size, image size, and print size - Adobe Evangelists Frank ess Digital Photography 0 11-14-2006 05:08 PM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
How to set the DataGrid Row Size to a fixed size. =?Utf-8?B?QmlkYXJrb3Rh?= ASP .Net 0 05-19-2005 08:14 PM



Advertisments