Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Web User Control - ListItemCollection

Posted on 2008-06-13
1
Medium Priority
?
674 Views
Last Modified: 2012-06-21
I am using VS 2005 and VB.net. I have a web user control that I have added a drop down list. I would like to add custom property of list item collection. I would like for the property to display in the properties window on visual studio. I can't seem to get this to work. The property displays, but no elipsis to add items to the collection. Any help?
*************html********************
<table>
    <tr>
        <td align="right">
            Filter where:</td>
        <td>
            <asp:DropDownList ID="ddlDimFilt" runat="server" AppendDataBoundItems="True">
            </asp:DropDownList>
        </td>
        <td>
            <asp:DropDownList ID="ddlDimLimiter" runat="server">
                <asp:ListItem Selected="True">Begins with</asp:ListItem>
                <asp:ListItem>Contains</asp:ListItem>
                <asp:ListItem>is Exactly</asp:ListItem>
            </asp:DropDownList>
        </td>
        <td>
            <asp:TextBox ID="txtDimFilter" runat="server" ValidationGroup="DimFilter" Width="128px"></asp:TextBox>
            <asp:RequiredFieldValidator ID="rfvDimFilter" runat="server" ControlToValidate="txtDimFilter"
                ErrorMessage="Filter text required" ValidationGroup="DimFilter">*</asp:RequiredFieldValidator>
        </td>
        <td>
            <asp:Button ID="btnDimFilter" runat="server" Text="Filter" ValidationGroup="DimFilter" />
            <asp:Button ID="btnDimClear" runat="server" Text="Clear" />
        </td>
    </tr>
</table>
 
*************html********************
 
************code behind snippet**************
Public ReadOnly Property Items() As ListItemCollection
        Get
            If Me._cItems Is Nothing Then
                Me._cItems = New ListItemCollection()
            End If
            Return Me._cItems
        End Get
    End Property
 
    Protected Overloads Overrides Sub CreateChildControls()
        If Me._cItems Is Nothing Then
            Me._cItems = New ListItemCollection()
        End If
        If _cItems.Count > 0 Then
            For Each item As ListItem In _cItems
                Me.ddlDimFilt.Items.Add(item)
            Next
        End If
    End Sub
 
    Public Overloads Overrides Sub DataBind()
        CreateChildControls()
        ChildControlsCreated = True
        Me.ddlDimFilt.DataBind()
        MyBase.DataBind()
    End Sub
************code behind snippet**************

Open in new window

0
Comment
Question by:Gary2397
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 16

Accepted Solution

by:
ororiole earned 2000 total points
ID: 21789514
User controls will not give you design time editors thru the ellipsis button. For that you would need to create a custom control (derive from webcontrol) and then implement your design time editor, which is s windows form by deriving from one of the UI editor types.

Since your user control includes a rich set of web controls and layout, your best bet is to stick with the user control and do without the collection design time editor.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question