473,548 Members | 2,604 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Width/Length of Data Column

Is there a way to define how long the data columns are, display wise
on the Form?

Whether I am using a boolean field (checkbox) or a string field (text
url) each displays with the same size.
I know you can select all the columns and resize them after the fact,
but is there a way to set each columns size default so when it
displays it is not huge like for the boolean or cut off like for the
string field..
Let me know if you need more information.

Thanks!!

Mar 23 '07 #1
2 4274
schaapiee wrote:
Is there a way to define how long the data columns are, display wise
on the Form?

Whether I am using a boolean field (checkbox) or a string field (text
url) each displays with the same size.
<snip>

I'm not sure if I get you. In desing mode you can edit each of the
columns widht by right clicking in the table, selectig edit Columns
and, for each column, set its specific width (which, can also be done
at run time, btw, accessing the grid's Columns property)

If your table doesn't have too many columns you may prefer to activate
the grid's automatic fill mode: set the grid's AutoSizeColumns Mode to
Fill and set each Column's FillWeight property to a value relative to
its proportion in the grid (bigger values, more space).

HTH.

Regards,

Branco.

Mar 23 '07 #2
On Mar 23, 12:14 pm, "Branco Medeiros" <branco.medei.. .@gmail.com>
wrote:
schaapiee wrote:
Is there a way to define how long the data columns are, display wise
on the Form?
Whether I am using a boolean field (checkbox) or a string field (text
url) each displays with the same size.

<snip>

I'm not sure if I get you. In desing mode you can edit each of the
columns widht by right clicking in the table, selectig edit Columns
and, for each column, set its specific width (which, can also be done
at run time, btw, accessing the grid's Columns property)

If your table doesn't have too many columns you may prefer to activate
the grid's automatic fill mode: set the grid's AutoSizeColumns Mode to
Fill and set each Column's FillWeight property to a value relative to
its proportion in the grid (bigger values, more space).

HTH.

Regards,

Branco.
Ok here is what I am talking about..

System.Windows. Forms.Data Grid
Properties: Layout-Preferred Column Width = 75

This sets a default for all columns, but how can I set this for each
column individually so each column better fits with the width of the
longest item in each column? My actual columns do not show until
runtime; in design mode only the datagrid shows.
Hope this helps..thanks for the help!

Mar 26 '07 #3

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

Similar topics

2
3166
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 ==================================================
1
1803
by: venky | last post by:
HI guys, In one of my columns in the grid, i want to set the width of the grid to the widest entry in the column when i click on the column seperator. How can i calcualte the column width if i know the lenght of the longest string?
5
3627
by: VB Programmer | last post by:
I have a simple datagrid on a webform. (I'm using VB.NET.) In the page load I get some data, set the .DataSource property of the dg, then do a .DataBind. The columns are automatically created. Question: How can I dynamically change the width's of these columns? Thanks in advance.
2
2705
by: nj | last post by:
I am trying to set the width of a single column in the datagrid. What is happening is the column seems to stretch to try to accomodate the length of the data contained in it. I want to have it only x number of pixels wide and the data to wrap if necessary. I have tried several things to set the column width but it seems to ignore everything I try....
1
1558
by: schaapiee | last post by:
Is there a way to define how long the data columns are, display wise on the Form? Whether I am using a boolean field (checkbox) or a string field (text url) each displays with the same size. I know you can select all the columns and resize them after the fact, but is there a way to set each columns size default so when it displays it is...
2
2325
by: RKSpangler | last post by:
Greetings: Is there any way to determine the maximum width of all data elements in a particular column in a table? Sorting a column won't do it, of course, since it will use a collating sequence based on the content of the data. I want to know, for example, that the maximum width of a (non-blank) populated field in a table is, say, 10...
5
1587
by: =?Utf-8?B?TWlrZSBPS0M=?= | last post by:
How do I get the width of a column using Type Datasets? I don't want to know the length of the data in the column, I want to know the width of the column. In my code, if the column width is 50 characters, but a string with 55 characters tries to insert then I get runtime error. So, I want the width of the column so I can cut out that number of...
5
54674
by: mohaaron | last post by:
OK, I have now gone through lots of posts, and there are lots, looking for a anwer as to why I can't set the width of the columns in my gridview. So far I have tried the following methods to set the width and nothing works. 1. <asp:BoundField HeaderText="fieldName" ItemStyle-Width="300px" DataField="fieldName" /> 2. <asp:BoundField...
4
3967
by: Jeff | last post by:
Hey I'm wondering how the Fixed-Width Text Format is What I know is that the top line in this text format will contain column names. and each row beneath the top line represent for example a row in a table etc... But does fixed-with mean that every column has a fixed with: for example first column is 10 char wide and second column is...
0
7438
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7707
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. ...
0
7951
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...
1
7466
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7803
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...
0
5082
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...
0
3475
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1926
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 we have to send another system
1
1051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.