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. Grid view showing null columns

Grid view showing null columns

Scheduled Pinned Locked Moved ASP.NET
questioncss
5 Posts 4 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.
  • L Offline
    L Offline
    LucBite
    wrote on last edited by
    #1

    I have a data gridview on which I want to display data from a datatable. For some unknown reasons, the datatable returns the expected columns plus other unexpected columns with no values in them.I've checked all of my stored procedures and methods that return the datatable and they seem to be fine. How do I limit the gridview to columns I need to see and restrict the other useless columns from displaying in my grid view? Forgive me if I'm in a wrong forum.

    ML Lingwati

    B A H 3 Replies Last reply
    0
    • L LucBite

      I have a data gridview on which I want to display data from a datatable. For some unknown reasons, the datatable returns the expected columns plus other unexpected columns with no values in them.I've checked all of my stored procedures and methods that return the datatable and they seem to be fine. How do I limit the gridview to columns I need to see and restrict the other useless columns from displaying in my grid view? Forgive me if I'm in a wrong forum.

      ML Lingwati

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      If you are using GridView control then use DataBoundFileds,if you are using dataGridView then you should post question in C# forum.


      I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com

      1 Reply Last reply
      0
      • L LucBite

        I have a data gridview on which I want to display data from a datatable. For some unknown reasons, the datatable returns the expected columns plus other unexpected columns with no values in them.I've checked all of my stored procedures and methods that return the datatable and they seem to be fine. How do I limit the gridview to columns I need to see and restrict the other useless columns from displaying in my grid view? Forgive me if I'm in a wrong forum.

        ML Lingwati

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        LucBite wrote:

        For some unknown reasons, the datatable returns the expected columns plus other unexpected columns with no values in them.

        I guess this is the problem with your SP/ Query that you have written :)

        LucBite wrote:

        How do I limit the gridview to columns I need to see and restrict the other useless columns from displaying in my grid view?

        You have to check it during RowDataBound Event :)

        Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article

        1 Reply Last reply
        0
        • L LucBite

          I have a data gridview on which I want to display data from a datatable. For some unknown reasons, the datatable returns the expected columns plus other unexpected columns with no values in them.I've checked all of my stored procedures and methods that return the datatable and they seem to be fine. How do I limit the gridview to columns I need to see and restrict the other useless columns from displaying in my grid view? Forgive me if I'm in a wrong forum.

          ML Lingwati

          H Offline
          H Offline
          Hemant Thaker
          wrote on last edited by
          #4

          Which are these columns.... Means r u getting same columns twice?? Just see that u haven't added columns at design time and also binding gridview at runtime.

          By: Hemant Thaker

          L 1 Reply Last reply
          0
          • H Hemant Thaker

            Which are these columns.... Means r u getting same columns twice?? Just see that u haven't added columns at design time and also binding gridview at runtime.

            By: Hemant Thaker

            L Offline
            L Offline
            LucBite
            wrote on last edited by
            #5

            Hemant Thaker wrote:

            Which are these columns.... Means r u getting same columns twice??

            No I mean, It includes columns returned by other datatables

            ML Lingwati

            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