Wednesday, August 11, 2010

How to increase the width of a particular column(only) of a datagrid in vb.net using code.?

Suppose im having 5 columns of which only one column is very lengthy.If i'm setting the width to lengthiest col : all r set to the same length.But i want that particular column be set to its max length instead.(I know i can drag it to its max length while running.But i want to that through coding only.).I'm using vb.net2005,sql2000.How to increase the width of a particular column(only) of a datagrid in vb.net using code.?
It's been a long time since I used a datagrid, but I believe it's something like





Datagrid.Columns(3).Width = 52





Use whichever column and whatever length you need. (The width is in what you have its measurement set to - twips, pixels, etc., not characters. You'll have to calculate the width of the string in that column in its measurement if you want toe column to be that number of characters wide.)How to increase the width of a particular column(only) of a datagrid in vb.net using code.?
colanth is correct :)

Report Abuse


  • love myspace
  • myspace girl
  • No comments:

    Post a Comment