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. How to retain Cell width in Datagrid? [modified]

How to retain Cell width in Datagrid? [modified]

Scheduled Pinned Locked Moved ASP.NET
helpcsstutorialquestion
3 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.
  • V Offline
    V Offline
    Vsree
    wrote on last edited by
    #1

    Hi Am using a Datagrid with 5 columns Name,Address,City,Country and Phone Number. And i have set the width of the Grid. The problem is, when the Address field retreives a lengthier row, the width of the Grid also expands,even though i have set its width and in Property Builder --> Format --> Items also i have Checked 'Wrap text within cell' checkbox. I dont want my Datagrid to grow in width though the fields have lengthier data,they need to be wrapped inside the cell itself. Please help me to do this...:( Thanx in advance -- modified at 3:49 Thursday 18th January, 2007

    U 1 Reply Last reply
    0
    • V Vsree

      Hi Am using a Datagrid with 5 columns Name,Address,City,Country and Phone Number. And i have set the width of the Grid. The problem is, when the Address field retreives a lengthier row, the width of the Grid also expands,even though i have set its width and in Property Builder --> Format --> Items also i have Checked 'Wrap text within cell' checkbox. I dont want my Datagrid to grow in width though the fields have lengthier data,they need to be wrapped inside the cell itself. Please help me to do this...:( Thanx in advance -- modified at 3:49 Thursday 18th January, 2007

      U Offline
      U Offline
      unchecked
      wrote on last edited by
      #2

      haven't you tried to set the HeaderStyle-Width property of your BoundField columns to your desired width? like -> //mastereuo On Error GoTo Hell

      V 1 Reply Last reply
      0
      • U unchecked

        haven't you tried to set the HeaderStyle-Width property of your BoundField columns to your desired width? like -> //mastereuo On Error GoTo Hell

        V Offline
        V Offline
        Vsree
        wrote on last edited by
        #3

        Ya...i have tried that here it is: asp:BoundColumn DataField="Address" HeaderText="Contact" HeaderStyle-Width="30%"> But in vain...anyother alternatives?

        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