Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Adjusting column widths fr a DataGrid

Posted on 2006-11-04
Medium Priority
Last Modified: 2010-04-16


Here's the code I use to format the columns:

driverStatData = new DataSet();
driverStatTable = new DataTable("DriverStatsTable");
driverStatTable.Columns.Add(new DataColumn("Statistic", typeof(string)));
driverStatTable.Columns.Add(new DataColumn("Col 1", typeof(double)));
driverStatTable.Columns.Add(new DataColumn("Col 2", typeof(double)));
driverStatTable.Columns.Add(new DataColumn("Percent", typeof(string)));

How do I give the first column more width?

Question by:ba272
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 35

Accepted Solution

Raynard7 earned 2000 total points
ID: 17875274

Depending on your needs the following two links should help:
http:Q_21726249.html "windows form datagrid"
http:Q_21517523.html "Expanding the column of a datagrid on load"

alternativley for more information you can refer to:;en-us;812422
LVL 35

Expert Comment

ID: 17875317
Thanks for the mark and the grade.

Author Comment

ID: 17875322
no problem...

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question