Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. auto size of gridview column

auto size of gridview column

Scheduled Pinned Locked Moved ASP.NET
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pankaj Garg
    wrote on last edited by
    #1

    Is there any way to make the gridview column autosize.I mean it the cell contains 100 characters , then the cell should itself adjust the text in one line

    If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

    A 1 Reply Last reply
    0
    • P Pankaj Garg

      Is there any way to make the gridview column autosize.I mean it the cell contains 100 characters , then the cell should itself adjust the text in one line

      If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

      A Offline
      A Offline
      ashish bhakhar
      wrote on last edited by
      #2

      you can not do this because in any column the records in each row has not fixed size. some contains 5 characters and some contains 55 characters. so if you want to auto size the columns then your column will be expands more worthless, for ex: there are 10 rows in grid. 9 columns have 20 characters & 10th column has 90 characters than the layout of grid will not shows in regular manner. so, instead of these you have to set wrap property to the columns and give some fixed width by approximation of column name. for column of id there is no need to give size as same as other columns like details column.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups