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. summary classes for gridview

summary classes for gridview

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

    hello all, I have a object list(Customers) which I am binding to a gridview. Problem is that the Customers object has 30 fields/attributes & I am binding only 6 in the gridview columns, the rest are wasted. Should I make another class to deal with gridview only,but that would mean a lot of classes for gridviews alone ? Is there a way I can do this with inheritance making a child class or something ? Please help me. Thanks, Mike.

    T D M 3 Replies Last reply
    0
    • Z zeego

      hello all, I have a object list(Customers) which I am binding to a gridview. Problem is that the Customers object has 30 fields/attributes & I am binding only 6 in the gridview columns, the rest are wasted. Should I make another class to deal with gridview only,but that would mean a lot of classes for gridviews alone ? Is there a way I can do this with inheritance making a child class or something ? Please help me. Thanks, Mike.

      T Offline
      T Offline
      Tej Aj
      wrote on last edited by
      #2

      U can make another class for having required columns only, coz it may create performance overhead when u have huge no. of records tht r fetched n displayed. http://www.opexsolution.com/forum/[^]

      Z 1 Reply Last reply
      0
      • T Tej Aj

        U can make another class for having required columns only, coz it may create performance overhead when u have huge no. of records tht r fetched n displayed. http://www.opexsolution.com/forum/[^]

        Z Offline
        Z Offline
        zeego
        wrote on last edited by
        #3

        Yes I know but what is recommended, using inheritance with the superclass or a new class overall ? Thanks, Mike.

        T 1 Reply Last reply
        0
        • Z zeego

          Yes I know but what is recommended, using inheritance with the superclass or a new class overall ? Thanks, Mike.

          T Offline
          T Offline
          Tej Aj
          wrote on last edited by
          #4

          inheritance would be better http://www.opexsolution.com/forum/[^]

          Z 1 Reply Last reply
          0
          • T Tej Aj

            inheritance would be better http://www.opexsolution.com/forum/[^]

            Z Offline
            Z Offline
            zeego
            wrote on last edited by
            #5

            how about using a data transfer object ? Do you have any example ?:~

            1 Reply Last reply
            0
            • Z zeego

              hello all, I have a object list(Customers) which I am binding to a gridview. Problem is that the Customers object has 30 fields/attributes & I am binding only 6 in the gridview columns, the rest are wasted. Should I make another class to deal with gridview only,but that would mean a lot of classes for gridviews alone ? Is there a way I can do this with inheritance making a child class or something ? Please help me. Thanks, Mike.

              D Offline
              D Offline
              Dinesh Mani
              wrote on last edited by
              #6

              Creating a class and accessing the base class to get the data out is anyway going to waste your memory. Actually you will be wasting double the memory by doing it this [Memory for your original class and memory for the new class with the filtered data]. Its is better to either put a different class that pulls out only the data required for the grid or to leave your system as-is. Just my 2 cents. HTH!

              1 Reply Last reply
              0
              • Z zeego

                hello all, I have a object list(Customers) which I am binding to a gridview. Problem is that the Customers object has 30 fields/attributes & I am binding only 6 in the gridview columns, the rest are wasted. Should I make another class to deal with gridview only,but that would mean a lot of classes for gridviews alone ? Is there a way I can do this with inheritance making a child class or something ? Please help me. Thanks, Mike.

                M Offline
                M Offline
                michaelschmitt
                wrote on last edited by
                #7

                The academic way would certainly be to bind a collection of objects which only contain the absolute necessary properties. (Keep the view as stupid as possible) This way, the view cannot mess with data he is not ment to have.. But to be honest, if i dont have huge business entities - maybe even with some crucial methods inside (uh uh), i use them directly within the view. It always depends on the situation i guess. But thats just my opinion.

                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