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. Assign data value in GridView Template

Assign data value in GridView Template

Scheduled Pinned Locked Moved ASP.NET
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.
  • H Offline
    H Offline
    Hampden Tech
    wrote on last edited by
    #1

    I'm trying to assign a data value in a gridview template during the databind operation. I've replaced the Bind("column_name") with a custom function. In that function, I want to take one of the values from the datatable's rowset (a vendor number) and lookup the name for that vendor returning that as a string. The following code is what I am trying to accomplish.

    M 1 Reply Last reply
    0
    • H Hampden Tech

      I'm trying to assign a data value in a gridview template during the databind operation. I've replaced the Bind("column_name") with a custom function. In that function, I want to take one of the values from the datatable's rowset (a vendor number) and lookup the name for that vendor returning that as a string. The following code is what I am trying to accomplish.

      M Offline
      M Offline
      MartyExodus
      wrote on last edited by
      #2

      First of all.... you're going to want to close your tag there... it should say And.... why not just select the vendor name to begin with? Why go through the extra step of converting a vendor number?

      H 1 Reply Last reply
      0
      • M MartyExodus

        First of all.... you're going to want to close your tag there... it should say And.... why not just select the vendor name to begin with? Why go through the extra step of converting a vendor number?

        H Offline
        H Offline
        Hampden Tech
        wrote on last edited by
        #3

        The closing tag is probably just an error when copying and editing the code in my post. The vendor name is coming from a different database so I can't include the name in the select statement. Excellent question though!

        N 1 Reply Last reply
        0
        • H Hampden Tech

          The closing tag is probably just an error when copying and editing the code in my post. The vendor name is coming from a different database so I can't include the name in the select statement. Excellent question though!

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          Hampden Tech wrote:

          The vendor name is coming from a different database so I can't include the name in the select statement.

          If you have a data access layer that provides the resultsets appropriate for the presentation layer you won't have this problem.


          only two letters away from being an asset

          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