Solved

Adjusting column widths fr a DataGrid

Posted on 2006-11-04
3
250 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
[X]
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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 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