|
-
Feb 23rd, 2003, 05:17 AM
#1
Thread Starter
Lively Member
How to set a grid column width?
Hi all!
With
DataGrid1.PreferredColumnWidth = DefaultWidth
I can set the default starting width for each column.
But How can I set a width for a single Column?
Thank you!
-
Feb 24th, 2003, 06:19 PM
#2
New Member
// create table style
foreach(DataTable t in data.Tables)
{
dataGridTableStyle1.MappingName = t.TableName;
dataGrid1.TableStyles.Add(dataGridTableStyle1);
}
dataGrid1.SetDataBinding(data, "table");
DBs.Close();
// set the column widths
GridColumnStylesCollection myGridColumns;
myGridColumns = dataGrid1.TableStyles[0].GridColumnStyles;
myGridColumns[0].Width = 90;
myGridColumns[1].Width = 200;
myGridColumns[2].Width = 75;
myGridColumns[3].Width = 75;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|