summary classes for gridview
-
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.
-
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.
-
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/[^]
-
Yes I know but what is recommended, using inheritance with the superclass or a new class overall ? Thanks, Mike.
-
inheritance would be better http://www.opexsolution.com/forum/[^]
-
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.
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!
-
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.
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.