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...




Threaded View
Threaded View
Greg McGuffey - 19 Years Ago
StrataFrame Team - 19 Years Ago
             Perfect! Thanks!
Greg McGuffey - 19 Years Ago
StrataFrame Team - 19 Years Ago
                     OK, I must have moved onto the second gotcha :crazy:...

I...
Greg McGuffey - 19 Years Ago
                         That's strange, the Items property is ReadOnly... what does the error...
StrataFrame Team - 19 Years Ago
                             When I attempt to open the type editor I get an error. I've attached a...
Greg McGuffey - 19 Years Ago
                                 I'm not sure... I'll have to test this. That's not our type editor,...
StrataFrame Team - 19 Years Ago
                                     Thanks. Yeah, I know it is the .NET type editor. Also, unless there...
Greg McGuffey - 19 Years Ago
                                         Yeah, exposing the toolstrip is a good way to do it... most likely,...
StrataFrame Team - 19 Years Ago
                                             ah....:satisfied:
Greg McGuffey - 19 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search