El Guru Programador
Usuario DESCONOCIDO | Registrate Gratis | Usuarios Registrados
Foro de Visual Basic/VB.NET
Foros del Guru > Visual Basic/VB.NET
Usuario datagrid ajustar ancho de columnas
mr_bungle22
32 Mensaje(s)
Enviado - 25/9/2004
 
necesito alinear el datagrid...me refiero a agustar las columnas con anchos diferentes ya que al ejecutar mi programa todas tienen el mismo ancho.....

que propiedades debo utilizar??
 
severian
7 Mensaje(s)
Enviado - 26/9/2004
 
esta en la MSDN, tanto en los cds como en la web. Es asi:

Me.DataGrid1.Columns(0).Width = 300
Me.DataGrid1.Columns(1).Width = 600

Otra forma es esta (copio del help)

"If you set the DefColWidth property to 0, the control automatically sizes all columns based on either the width of the column heading or the Size property setting of the underlying field, whichever is larger. For example, to set the default column width of all columns to the width of the first column:

DataGrid1.DefColWidth = DataGrid1.Columns(0).Width"

Es decir, si pones datagrid1.DefColWidth = 0 ajusta automaticamente todas las columnas al ancho del valor mas ancho.

.Severian
 
 

 

Contactos myStudio Network