Hi,
I am adding the data binding feature to the list view control. I am bale to populate the column collection dynamically from the datasource. I would like to allow the user to remove or add any columns from this collection to the control. When I removed some of the column items in this collection from the collection editor on the properties window, this collection is not persisting the items and when i go back in to the form, it contains all the items from the datasource.
I have checked the code generated in the designer, there is nothing about this column collection. BUT if i add the column item manually to this collection, this new item appears in the designer with the addrange method.
i have got the listviewcolumnheader class and listviewcolumnheadercollection class which implements the collectionbase with add, addrange methods and indexer as well.
I have set the following design attributes on the collection property.
[Description("Gets the columns that are avialable in the datasource."), Browsable(true), Category("Data"),
DesignOnly(false), Bindable(BindableSupport.No)]
[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)]
[EditorAttribute(typeof(System.ComponentModel.Desig n.CollectionEditor), typeof(System.Drawing.Design.UITypeEditor))]
public ListViewColumnHeaderCollection DetailColumns
{
get { return _detailColumns; }
}
Any help would be appreciated.
Thanks