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. Best way to go about displaying varchar(MAX) fields; Gridview

Best way to go about displaying varchar(MAX) fields; Gridview

Scheduled Pinned Locked Moved ASP.NET
databasehelpquestion
4 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.
  • A Offline
    A Offline
    aqzman_
    wrote on last edited by
    #1

    Hey guys, I don't really have a problem, I'm just looking for the best way to do something. I have an entry form where some information needs to be entered into a SQL database, but it's in a (Two of these fields, actually) Varchar(MAX) field. So the information entered could be one line, or a paragraph. There's really no way for me to know. I need to display several fields from three different databases into a gridview (that's already done) including the two varchar(MAX) fields. So my question is, what would be the best way to go about this? I know I could just let it all just display in the gridview as is, but that would probably really make things look untidy and unorganized if there were paragraph style enteries for all 10 records displaying on a page. Any suggestions would help. Thanks, aqzman

    T K 2 Replies Last reply
    0
    • A aqzman_

      Hey guys, I don't really have a problem, I'm just looking for the best way to do something. I have an entry form where some information needs to be entered into a SQL database, but it's in a (Two of these fields, actually) Varchar(MAX) field. So the information entered could be one line, or a paragraph. There's really no way for me to know. I need to display several fields from three different databases into a gridview (that's already done) including the two varchar(MAX) fields. So my question is, what would be the best way to go about this? I know I could just let it all just display in the gridview as is, but that would probably really make things look untidy and unorganized if there were paragraph style enteries for all 10 records displaying on a page. Any suggestions would help. Thanks, aqzman

      T Offline
      T Offline
      Tarakeshwar Reddy
      wrote on last edited by
      #2

      Have you tried looking into Master-Detail view? You could have a DetailView created and on the select event display the two fields in the DetailView rather than the gridview.


      Tarakeshwar Reddy MCP, CCIE Q(R&S) There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi

      1 Reply Last reply
      0
      • A aqzman_

        Hey guys, I don't really have a problem, I'm just looking for the best way to do something. I have an entry form where some information needs to be entered into a SQL database, but it's in a (Two of these fields, actually) Varchar(MAX) field. So the information entered could be one line, or a paragraph. There's really no way for me to know. I need to display several fields from three different databases into a gridview (that's already done) including the two varchar(MAX) fields. So my question is, what would be the best way to go about this? I know I could just let it all just display in the gridview as is, but that would probably really make things look untidy and unorganized if there were paragraph style enteries for all 10 records displaying on a page. Any suggestions would help. Thanks, aqzman

        K Offline
        K Offline
        kubben
        wrote on last edited by
        #3

        I have used a multi-line textbox. So then I can set the width and there is a scroll bar. The only issue is when you only have one line or no data at all then it looks a little weird to have a fixed multi-line textbox. I have written some code that checks the length and then decides which control to so. When there is big enough string I use the multi-line textbox if it is smaller then I just a label. Hope that helps. Ben

        A 1 Reply Last reply
        0
        • K kubben

          I have used a multi-line textbox. So then I can set the width and there is a scroll bar. The only issue is when you only have one line or no data at all then it looks a little weird to have a fixed multi-line textbox. I have written some code that checks the length and then decides which control to so. When there is big enough string I use the multi-line textbox if it is smaller then I just a label. Hope that helps. Ben

          A Offline
          A Offline
          aqzman_
          wrote on last edited by
          #4

          Thanks for both of your replies! I'll try your method, kubben.

          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