Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > How to make Editor for ListItemCollection visible in VS2005 properties page?

Reply
Thread Tools

How to make Editor for ListItemCollection visible in VS2005 properties page?

 
 
cpnet
Guest
Posts: n/a
 
      09-10-2007
I'm trying to build a User Control in C# for ASP.NET 2.0. My user control
contains two ListBoxes. I am exposing the Items property of each ListBox as
public properties of my User Control. That part works ok. But, I can't get
a collection editor to show for the items properties of my User Control.
How can I do this? Here's what I'm trying so far:


[EditorBrowsable(EditorBrowsableState.Always)]
[Editor("System.ComponentModel.Design.CollectionEdi tor",
typeof(System.Drawing.Design.UITypeEditor)]
[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Visible)]
public ListItemCollection Items1
{
get
{
return ListBox1.Items;
}
}


I see my "Items1" property in the property page in VS2005 at design time,
but the button to open up the collection editor is not there. I've tried
different combinations of the attributes above to no avail. What am I doing
wrong? Does ListItemCollection have a default Editor that should just show
up if I don't include any attributes (this doesn't happen for me)?

Thanks,
cpnet


 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      09-11-2007
Hi cpnet,

Due to how the UserControl is designed to work within the VSIDE, I don't
think it's possible to achieve your objective here. I think you will need
to create a custom server control (a composite control) to do that. Though
this requires much code change. Please let me know if you need further
information on how to do this with a custom server control.


Regards,
Walter Wang ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
 
cpnet
Guest
Posts: n/a
 
      09-11-2007
Hi Walter,

I was beginning to suspect that this was the case. I've built server
controls before so I should be ok to do that. I was just hoping to use a
user control because this is just something quick and dirty for a prototype.

Thanks,
cpnet


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Hide textbox / Make textbox not visible (NOT USING visible property) Jurjen de Groot ASP .Net Web Controls 0 05-19-2008 09:50 AM
Making Custom Control Properties Visible in Visual Studio's Properties Palette Nathan Sokalski ASP .Net 0 10-17-2005 02:05 AM
How to make a hyperlink Visible or not visible in DataList Patrick Olurotimi Ige ASP .Net 7 06-15-2005 12:01 PM
Panel.Visible = True also make child controls visible. spamfurnace ASP .Net 1 05-24-2004 03:07 AM



Advertisments