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. Problem with datagrid fixed column

Problem with datagrid fixed column

Scheduled Pinned Locked Moved ASP.NET
helpquestion
6 Posts 3 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.
  • K Offline
    K Offline
    Kanjinghat
    wrote on last edited by
    #1

    Dear All, i have a datagrid control with 3 columns. the first column is a template column with radio buttons. to keep the Column width fixed i added the attributes "TABLE-LAYOUT: fixed ; OVERFLOW:hidden". It is woking fin. But the problem is that the radio button column also have the same size as the remaining and it is not looking good.Can i keep the radio button column to a fixed width? at the same time i want that the cell data should be clipped if it exceeds the cell width. ThanX in advance

    Ramesh.Kanjinghat

    L K K 3 Replies Last reply
    0
    • K Kanjinghat

      Dear All, i have a datagrid control with 3 columns. the first column is a template column with radio buttons. to keep the Column width fixed i added the attributes "TABLE-LAYOUT: fixed ; OVERFLOW:hidden". It is woking fin. But the problem is that the radio button column also have the same size as the remaining and it is not looking good.Can i keep the radio button column to a fixed width? at the same time i want that the cell data should be clipped if it exceeds the cell width. ThanX in advance

      Ramesh.Kanjinghat

      L Offline
      L Offline
      leckey 0
      wrote on last edited by
      #2

      you can actually word wrap the text rather than cutting it off

      K 1 Reply Last reply
      0
      • K Kanjinghat

        Dear All, i have a datagrid control with 3 columns. the first column is a template column with radio buttons. to keep the Column width fixed i added the attributes "TABLE-LAYOUT: fixed ; OVERFLOW:hidden". It is woking fin. But the problem is that the radio button column also have the same size as the remaining and it is not looking good.Can i keep the radio button column to a fixed width? at the same time i want that the cell data should be clipped if it exceeds the cell width. ThanX in advance

        Ramesh.Kanjinghat

        K Offline
        K Offline
        Khawar Abbas1
        wrote on last edited by
        #3

        Yes u can give width of each column in pixels and in percentages at the design time.

        Do good and have good.

        K 1 Reply Last reply
        0
        • L leckey 0

          you can actually word wrap the text rather than cutting it off

          K Offline
          K Offline
          Kanjinghat
          wrote on last edited by
          #4

          Well. Wrapping requires that the text has spaces embeded. Even it works it will increase the cell height. Actually i am providing tool tip to display the text clipped.

          Ramesh.Kanjinghat

          1 Reply Last reply
          0
          • K Khawar Abbas1

            Yes u can give width of each column in pixels and in percentages at the design time.

            Do good and have good.

            K Offline
            K Offline
            Kanjinghat
            wrote on last edited by
            #5

            ThanQ for the reply. I have tried that way too. but when i do so. the column with cell that have data exceeding the limit is getting enlarged as long as the data.

            Ramesh.Kanjinghat

            1 Reply Last reply
            0
            • K Kanjinghat

              Dear All, i have a datagrid control with 3 columns. the first column is a template column with radio buttons. to keep the Column width fixed i added the attributes "TABLE-LAYOUT: fixed ; OVERFLOW:hidden". It is woking fin. But the problem is that the radio button column also have the same size as the remaining and it is not looking good.Can i keep the radio button column to a fixed width? at the same time i want that the cell data should be clipped if it exceeds the cell width. ThanX in advance

              Ramesh.Kanjinghat

              K Offline
              K Offline
              Kanjinghat
              wrote on last edited by
              #6

              Hi friends, I got the work around for the above said problem. As i am setting the property TABLE-LAYOUT:fixed, the property will be apllied at client side. So we have to set the width of the columns using css class only. Below sample will help you understand the same. DataGrid1.Attributes.Add("style","TABLE-LAYOUT: fixed; OVERFLOW: hidden"); The above code will force the grid to have eqaul column widths. DataGrid1.Columns[0].ItemStyle.CssClass="SetWidth" where SetWidth is given as below in the style tag .SetWidth4Temps { WIDTH: 40px } Hope this will help you all. Cheers :-D Ramesh.Kanjinghat

              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