Click here to Skip to main content
15,890,670 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
how to change width code

VB
myTable.Columns.Add("Wkly Sum. (Y/N)", GetType(String))
       myTable.Columns.Add("Shake /Cereal", GetType(Int32))
       myTable.Columns.Add("Entrees", GetType(Int32))
Posted
Comments
Maciej Los 19-Aug-13 11:23am    
What is exact question?
PythonProgrammer 19-Aug-13 11:25am    
how do i give the column a specific width
Maciej Los 19-Aug-13 11:29am    
Are we talking about datatable or datagridview?
PythonProgrammer 19-Aug-13 11:31am    
data table
PythonProgrammer 19-Aug-13 11:34am    
i tried that and it does not work for my code

VB
datagrid.columns(yourColumn).autosizemode = fill
 
Share this answer
 
Datatable - you can't change width of column


DatagridView - have a look here:
DataGridView.AutoSizeColumnsMode Property [^]
DataGridViewColumn.Width Property[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900