473,806 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid / Columns / Autofit

Hello,

I assign a Datatable to a Datagrid.DataSo urce.

All the columns are displayed with the same width.

I would like them to be set automatically to the best width (something like
Autofit in Excel).

How can I do that ?

Thanks !
Jun 16 '06 #1
1 3068
myname,

Very simple create yourself an autowidth column

http://www.vb-tips.com/default.aspx?...5-f7841cece67a

I hope this helps,

Cor

"myname" <no****@ihatesp am.com> schreef in bericht
news:44******** @news.sncf.fr.. .
Hello,

I assign a Datatable to a Datagrid.DataSo urce.

All the columns are displayed with the same width.

I would like them to be set automatically to the best width (something
like
Autofit in Excel).

How can I do that ?

Thanks !

Jun 16 '06 #2

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

Similar topics

1
840
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems controlling the visibility of columns in the DataGrid control. The problem usually comes down to one fact. The DataGrid has a property called AutoGenerateColumns. The default value is "True". This means that when AutoGenerateColumns is set to True,...
3
4889
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
4
3500
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 snippet from my .css file: *************************** body { margin:0; padding:0;
2
6416
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
3
302
by: Sean | last post by:
Hello, I have created a Datagrid which is populated by my program. I would like to add code to cause each column to expand to fit its largest item. This is similar to the autofit in Excel. Is there a easy way to do this?
4
2821
by: Sean | last post by:
Hello, I would like to use the vb equivalent of the excel autofit in a datagrid. I need each column to be the size of its largest element. I do not want all the columns to be the same size. Any ideas on a clean way to do this? Sean
1
2198
by: Sean | last post by:
Hello, I have a vb application in which I populate a datagrid from a database. The grid populates fine and the data is correct. I need to autofit the columns so that the width of each column is as wide as the widest element in that column. I have been looking for a good way to do this, but nothing has worked. If you have been able to do this before, please write the code by which you accomplished this. Thanks,
1
1362
by: PLSH | last post by:
Good day, I hope some one can help. I would like to programmatically set the width of my webform datagrid columns. Preferably to a set width or otherwise to autofit the entire datagrid. Please can some one help me Thanks in advance.
0
1066
by: DBC User | last post by:
Hi, I have a datagridview and some of the columns values are too big to fit in a default column. I used the autofit as well and is working, but if someone changes the column size and then restore the size they need to resize it manually. I remember there is a way (like excel), if you double click on the column heading margin, it will expand the column to fit the values. How can I do that, is there a property that I am overlooking?
0
9719
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
9599
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10624
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
10111
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
9193
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
7650
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
6877
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
5546
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4330
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

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.