Solved

Adjusting column widths fr a DataGrid

Posted on 2006-11-04
3
241 Views
Last Modified: 2010-04-16

Hi,

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


driverStatData = new DataSet();
driverStatTable = new DataTable("DriverStatsTable");
driverStatData.Tables.Add(driverStatTable);
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?

Thanks.
Bob
0
Comment
Question by:ba272
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 500 total points
ID: 17875274
Hi,

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:
http://support.microsoft.com/default.aspx?scid=kb;en-us;812422
http://www.codeproject.com/cs/miscctrl/AutoResizeDataGrid.asp
http://www.codeproject.com/cs/miscctrl/WCsAutoSizeDataGrid.asp
0
 
LVL 35

Expert Comment

by:Raynard7
ID: 17875317
Thanks for the mark and the grade.
0
 

Author Comment

by:ba272
ID: 17875322
no problem...
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now