Anyway to expose ListView.Columns property?


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I have a SF Usercontrol that has a SF ListView on it. I would like to expose the Columns property as a public property of the Usercontrol, as this is needed to configure it (and I'd like to keep it declarative).



The problem is that the Columns property is Readonly (.Net limitation). I've tried defining the property as a ColumnHeaderCollection. This works fine for the Get section, but in the Set section I have to use code like:



For each col As ColumnHeader in value

Me.lvwAny.Columns.Add(col)

Next col



The property then shows up in the property windows and allows me to set columns, which show up at runtime. However as soon as I build it, the columns aren't associated with the ListView either at runtime or when I go back into design mode, though they are defined within the designer (i.e. individual ColumnHeader objects are defined, but not associated with the ListView at all).



Any ideas on how I might do this?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search