473,783 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hide the columns for members from parent class in grid

I have a derived class (DistributionIt em) that contains a few members.
Now I have a binding list of instances of this class to be displayed
in a grid.

However, extra columns are displayed from the parent class
(IWorkerItemBas e). How can I hide those members from the parent class
in the grid?

FYI, my code is below:

SortableBinding List<IWorkerIte mBasebaseList =
worker.Selected Items;

SortableBinding List<Distributi onItemdistList = new
SortableBinding List<Distributi onItem>();

foreach (IWorkerItemBas e bse in baseList)
{

// Safe cast
DistributionIte m dist = bse as DistributionIte m;

if (dist == null)
{
return;
}

// If it's DistributionIte m
distList.Add(di st);

}

c1FlexGrid1.Dat aSource = distList;
Jan 14 '08 #1
2 1250
My first thought is to edit the tags and restrict what is shown there.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************** *************** *************** ****
| Think outside the box!
|
*************** *************** *************** ****
"Curious" <fi********@yah oo.comwrote in message
news:83******** *************** ***********@j78 g2000hsd.google groups.com...
>I have a derived class (DistributionIt em) that contains a few members.
Now I have a binding list of instances of this class to be displayed
in a grid.

However, extra columns are displayed from the parent class
(IWorkerItemBas e). How can I hide those members from the parent class
in the grid?

FYI, my code is below:

SortableBinding List<IWorkerIte mBasebaseList =
worker.Selected Items;

SortableBinding List<Distributi onItemdistList = new
SortableBinding List<Distributi onItem>();

foreach (IWorkerItemBas e bse in baseList)
{

// Safe cast
DistributionIte m dist = bse as DistributionIte m;

if (dist == null)
{
return;
}

// If it's DistributionIte m
distList.Add(di st);

}

c1FlexGrid1.Dat aSource = distList;

Jan 14 '08 #2
I did that by setting the columns in the grid properties. However, it
still loads extra columns including those in the parent class. It
seems that it ignores the properties of the grid set in the grid
properties dialog, once the datasource is set in the code.
Jan 14 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3653
by: Suzanne Vogel | last post by:
Hi, Given: I have a class with protected or private data members, some of them without accessor methods. It's someone else's class, so I can't change it. (eg, I can't add accessor methods to the parent class, and I can't make some "helper" class a friend of the parent class to help in accessing the data.) Problem: I want to derive a class that has a copy constructor that properly copies those data members.
6
3014
by: Alex Sedow | last post by:
Example 1 interface I { string ToString(); } public class C : I { public void f() {
12
15679
by: Jerad Rose | last post by:
I searched for a while trying to find the answer to this, but to no avail. I am trying to find the best way (or any way) to dynamically show and hide groups of TR's. For example, I have a section of about 6 table rows that all need to be hidden if a certain condition is met. But I don't want to hide the whole table. And, I don't want to split up the table because the columns need to remain intact. I thought about using runat=server...
4
3349
by: Paul Wu | last post by:
Is there a way to constract a derived class that hides certain public members of a base class ? With the following code, a class that derives from DerivedClass can still see the member "Name" in the base class. Can anyone provide me with an example that will do what I need? Public Class BaseClass Private mName As String = "Bob" Public Overridable Function Name() As String Name = mName End Function End Class
5
1493
by: Shane Story | last post by:
I have a dataset with two tables. I make data view of each table, connect the parent table to one data grid and the child table to the other datagrid, with a row filter, that gets set when a user clicks a row in the parent. I have PK/FK in the tables to know what to display. I want to hide the PK/FK columns in the U/I, but still use them.
0
4166
by: Gian Paolo | last post by:
this is something really i can't find a reason. I have a form with a tabcontrol with tree pages, in the second page there is a Data GRid View. Plus i have a class. When i open the form i "inizialize" the Data Grid View (add a data sorce, filled with notthing at staratup, and hide some columns) when i put a code in the txtCLCOD textbox start a searsh. If i foud something i popolate the Data grid view on the second page. Now the magic if i...
14
2644
by: lovecreatesbea... | last post by:
Could you tell me how many class members the C++ language synthesizes for a class type? Which members in a class aren't derived from parent classes? I have read the book The C++ Programming Language, but there isn't a detail and complete description on all the class members, aren't they important to class composing? Could you explain the special class behavior in detail? Thank you very much.
4
6027
by: Luqman | last post by:
I have populated the Child Accounts and Parent Accounts in a Grid View Control, I want to hide the Select Column of Parent Accounts, but not the Child Accounts, is it possible ? I am using VS 2005 ? Best Regards, Luqman
9
9769
by: moondaddy | last post by:
using c# 3.5 I have list of business objects which I will use in lists for databinding and I want to hide some of the fields so they don't show up in the list control. some of my list will be: List<someClasslist Observable collections and a custom list derived from the BindingList.
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10083
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.