C
Curious
I have a derived class (DistributionItem) 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
(IWorkerItemBase). How can I hide those members from the parent class
in the grid?
FYI, my code is below:
SortableBindingList<IWorkerItemBase> baseList =
worker.SelectedItems;
SortableBindingList<DistributionItem> distList = new
SortableBindingList<DistributionItem>();
foreach (IWorkerItemBase bse in baseList)
{
// Safe cast
DistributionItem dist = bse as DistributionItem;
if (dist == null)
{
return;
}
// If it's DistributionItem
distList.Add(dist);
}
c1FlexGrid1.DataSource = distList;
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
(IWorkerItemBase). How can I hide those members from the parent class
in the grid?
FYI, my code is below:
SortableBindingList<IWorkerItemBase> baseList =
worker.SelectedItems;
SortableBindingList<DistributionItem> distList = new
SortableBindingList<DistributionItem>();
foreach (IWorkerItemBase bse in baseList)
{
// Safe cast
DistributionItem dist = bse as DistributionItem;
if (dist == null)
{
return;
}
// If it's DistributionItem
distList.Add(dist);
}
c1FlexGrid1.DataSource = distList;