By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,234 Members | 1,850 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,234 IT Pros & Developers. It's quick & easy.

Datagrid VB net

P: n/a
Hello,
I want to resize a the columns of a datagrid one by one. I can not find a
way to do it in vb net.
Thanks for your help.
Frantz
Mar 23 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
jvb
Fratnz,

Take a look at the DataGridTableStyles class. I think that may be what
you are looking for.

Mar 23 '06 #2

P: n/a
Thanks for your answer but I don't find it.
I f u have more...

"jvb" <go*****@gmail.com> a écrit dans le message de news:
11**********************@e56g2000cwe.googlegroups. com...
Fratnz,

Take a look at the DataGridTableStyles class. I think that may be what
you are looking for.

Mar 23 '06 #3

P: n/a
jvb
Try something like this

Private Sub Form1_Load(ByVal sender as Object, byval e as
System.EventArgs) Handles MyBase.Load

Me.DataGrid1.TableStyles.Add(CreateTableStyle("Tab leName"))

End Sub

Private Function CreateTableStyle(ByVal TableName As String) as
DataGridTableStyle
Dim MyColumn As New DataGridTextBoxColumn
Dim ReturnStyle As New DataGridTableStyle

ReturnStyle.MappingName = TableName

'Define Columns Here

ReturnStyle.GridColumnStyles.Add(MyColumn)

Return ReturnStyle

End Function

Mar 23 '06 #4

P: n/a

"Frantz" <fr**************@wanadoo.fr> wrote in message
news:44***********************@news.wanadoo.fr...
I want to resize a the columns of a datagrid one by one. I can not find a
way to do it in vb net.


Me.DataGridView1.Columns(0).Width = 222
Me.DataGridView1.Columns(1).Width = 333
.....

Mar 24 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.