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. DataGrid Display

DataGrid Display

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

    Hi, I have a column in my DataGrid which represents a foreign key. At the moment, it displays the ID for that key. I want it to display another column instead.. For example: User Table has (ID, Title, Firstname, Lastname) Title Table has (ID, Mr, Mrs) I want the data grid to show "title" as "Mr" or "Mrs" instead of "01" or "02", Please help, Thanks!

    S S 2 Replies Last reply
    0
    • D Dayekh

      Hi, I have a column in my DataGrid which represents a foreign key. At the moment, it displays the ID for that key. I want it to display another column instead.. For example: User Table has (ID, Title, Firstname, Lastname) Title Table has (ID, Mr, Mrs) I want the data grid to show "title" as "Mr" or "Mrs" instead of "01" or "02", Please help, Thanks!

      S Offline
      S Offline
      sanju0276
      wrote on last edited by
      #2

      Try this...... go to Datagrid property builder.. select the Bound column for ID and set its Text Field as Mr or Ms but DataField as ID should work

      Sanjeev

      D 1 Reply Last reply
      0
      • S sanju0276

        Try this...... go to Datagrid property builder.. select the Bound column for ID and set its Text Field as Mr or Ms but DataField as ID should work

        Sanjeev

        D Offline
        D Offline
        Dayekh
        wrote on last edited by
        #3

        Sorry I should have been clearer... The Title Table is expandable. So "Ms" and "Miss" and say "Master" can be added at a later date. This means the Column will be able to display the "title" dynamicly by querying the Title Table. Otherwise, the senario would be that I would just be able to input "Mr" and "Mrs" as regular strings. My issue is how exactly to query the table. I know I have to use an SQL View, but my efforts have been in vain :(

        1 Reply Last reply
        0
        • D Dayekh

          Hi, I have a column in my DataGrid which represents a foreign key. At the moment, it displays the ID for that key. I want it to display another column instead.. For example: User Table has (ID, Title, Firstname, Lastname) Title Table has (ID, Mr, Mrs) I want the data grid to show "title" as "Mr" or "Mrs" instead of "01" or "02", Please help, Thanks!

          S Offline
          S Offline
          Suresh Pirsquare
          wrote on last edited by
          #4

          put your code in The ItemDataBound Event of the Datagrid. :) Thanks & regards, Suresh Dayma

          Everything Is Possible!

          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