Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Column Width w/DataGrid control

Status
Not open for further replies.

logo

Programmer
Aug 22, 2001
56
US
Is there a way to change (in code) the widths of various columns in a datagrid?
 
It is rather simple just add this command line

grid.ColWidth(0) = 4000

0 is the colnumber you wanne change.
I hope this help you
 
This is not working. The colwidth method must not be a property of the datagrid control.
 
Hi Logo,

you can set the DataGrid colwidth Property at Design-time by:-

Selecting the DataGrid control on the form and right-clicking the mouse. Select Properties then the Layout tab.

I don't think you can change the column width at Run-time.

Thats another reason to use the MSFlexiGrid control instead of the DataGrid control because it does allow Run-time manipulation of the Colwidths. You would use code as suggested by TheMasterFly in order to achieve this.

Regards,

Codefish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top