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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid columns widths 1

Status
Not open for further replies.

CookieNZ

MIS
Apr 22, 2002
48
0
0
NZ
Has anybody successfully been able to preset the widths of certain columns in a datagrid? If so, how have you done it?
 
I found out after a looooooooooong time here you go:

Dim DGStyle = New DataGridTableStyle()

DataGrid.TableStyles.Add(DGStyle)
DGStyle.MappingName = "yourtablesnamegoeshere"

DGStyle.GridColumnStyles(0).width = 400

DGStyle.DataGrid.Refresh()

NB:
my datagrid is called datagrid :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top