HighTechTalks DotNet Forums  

DataGrid Column Widths

Dotnet VJSharp microsoft.public.dotnet.vjsharp


Discuss DataGrid Column Widths in the Dotnet VJSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Grimmthething
 
Posts: n/a

Default DataGrid Column Widths - 11-05-2004 , 11:03 PM






I am having trouble setting my column widths at run-time. I realize i
must make a Table Style, and a Column Style, it compiles, but the
datagrid column never changes. I even tried adding one at compile-time,
(that didnt' work) and taking .Nets code directly and applying it at
run-time, which also didn't work. Here is my code, any ideas? (dgd is
the dataGrid, and "Description" is the column name i was trying to
set).

DataGridTableStyle dataGridTableStyle1;
DataGridTextBoxColumn dataGridTextBoxColumn1;
dataGridTableStyle1 = new System.Windows.Forms.DataGridTableStyle();
dataGridTextBoxColumn1 = new
System.Windows.Forms.DataGridTextBoxColumn();
//
// dataGridTableStyle1
//
dataGridTableStyle1.set_DataGrid(dgd);
dataGridTableStyle1.get_GridColumnStyles().AddRang e(new
DataGridColumnStyle[]
{
dataGridTextBoxColumn1}
);
dataGridTableStyle1.set_HeaderForeColor(System.Dra wing.SystemColors.get_ControlText());
dataGridTableStyle1.set_MappingName("");
//
// dataGridTextBoxColumn1
//
dataGridTextBoxColumn1.set_Format("");
dataGridTextBoxColumn1.set_FormatInfo(null);
dataGridTextBoxColumn1.set_MappingName("Descriptio n");
dataGridTextBoxColumn1.set_Width(50);


Reply With Quote
  #2  
Old   
Grimmthething
 
Posts: n/a

Default Re: DataGrid Column Widths - 11-06-2004 , 10:09 AM






Will this not set all column widths in the datagrid? i need to be able
to set columns individually.


Reply With Quote
  #3  
Old   
Grimmthething
 
Posts: n/a

Default Re: DataGrid Column Widths - 11-06-2004 , 10:09 AM



Will this not set all column widths in the datagrid? i need to be able
to set columns individually.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.