'Error Creating Control' ... 'true' could not be set on property 'ShowRadioButtons'

I have created a custom control which inherits from a compositeControl.

Its all works well in the browser but when I show it in the design mode I geta gray box with the following message

Error Creating Control - GroupPicker1
'true' could not be set on property 'ShowRadioButtons'.

The Property is a fairly standard get and set

Public Property ShowRadioButtons() As Boolean
            Get
                Return
rowRadioButtons.Visible
            End Get
            Set
(ByVal value As Boolean)
                EnsureChildControls()
                rowRadioButtons.Visible = value
               
            End Set
        End Property

Any help much appreciated 

 

0
Bow99
7/9/2007 8:54:53 AM
asp.net.custom-server-controls 3498 articles. 0 followers. Follow

3 Replies
1182 Views

Similar Articles

[PageSpeed] 45

 Hi,

Try using BrowsableAttribute on the property like:

<Browable(True)>_
Public Property ShowRadioButtons() As Boolean

Is it possible for you to post the source code of the entire control here?


- Sujit

Dont forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
0
sujitm
7/10/2007 7:32:54 AM

Hi there

Thanks for your help but the issue seems to not cause me any problems like that now. (I just continued to write the control and work out the design issue later). The only thing I think may have solved it was that I added an ensureChildControl before each set.

I now have a different issue but along the same lines as the first. Now then I go to the design page I can see my control (now with no error) but when I try and edit the properties for example to change the "ShowTo" property (which is an enumeration) it does not allow me to select using the dropdown to: ShowToAll, it changes the source but not the properties window. Is there somekind of designer attribute?

 

Oh the code is quite long now (about 700 lines) but here it is.

 

'Option Strict On
Imports System
Imports System.ComponentModel
Imports System.Drawing
Imports System.Security.Permissions
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Collections.ObjectModel

Namespace UI


    < _
        AspNetHostingPermission(SecurityAction.Demand, _
        Level:=AspNetHostingPermissionLevel.Minimal), _
        AspNetHostingPermission(SecurityAction.InheritanceDemand, _
        Level:=AspNetHostingPermissionLevel.Minimal), _
        ToolboxData("<{0}:GroupPicker runat=""Server"" id=""GroupPicker""> </{0}:GroupPicker>") _
    > _
    Public Class GroupPicker
        Inherits CompositeControl

#Region "Event Handling stuff"

        Public Event AddButtonClicked(ByVal sender As Object, ByVal e As EventArgs)
        Public Event RemoveButtonClicked(ByVal sender As Object, ByVal e As EventArgs)
        Public Event RadioButtonSelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)


        Protected Overridable Sub OnAddButtonClicked(ByVal e As EventArgs)
            RaiseEvent AddButtonClicked(Me, e)
        End Sub

        Protected Overridable Sub OnRemoveButtonClicked(ByVal e As EventArgs)
            RaiseEvent RemoveButtonClicked(Me, e)
        End Sub

        Protected Overridable Sub OnRadioButtonSelectedIndexChanged(ByVal e As EventArgs)
            RaiseEvent RadioButtonSelectedIndexChanged(Me, e)
        End Sub


#End Region



#Region "Variables"
        '------------------UI Table------------------------

        Private tabLayoutTable As Table

        Private rowRadioButtons As TableRow
        Private cellRadioButtons As TableCell

        Private rowHeaderLabels As TableRow
        Private cellLeftHeader As TableCell
        Private cellButtonsHeader As TableCell
        Private cellRightHeader As TableCell

        Private rowMainArea As TableRow
        Private cellLeftList As TableCell
        Private cellButtons As TableCell
        Private cellRightList As TableCell

        '------------------End of UI Table-----------------

        '------------------UI Elements---------------------

        Private RbtnShowTo As RadioButtonList
        'Left List
        Private lblLeftListHeading As Label
        Private lbxLeftList As ListBox

        'Right List
        Private lbxRightList As ListBox
        Private lblRightListHeading As Label

        'Buttons
        Private btnAdd As Button
        Private litBreak As Literal
        Private btnRemove As Button
        '------------------End of UI Elements--------------

        '------------------Other Elements------------------
        Private _LeftCollection As Object
        Private _RightCollection As Object
        '------------------End of Other Elements-----------

#End Region

        Public Enum ShowToOptions
            NoneSelected = 2
            ShowToAll = 1
            ShowToSpecific = 0
        End Enum

#Region "Properties"

#Region "SkinID properties"

        ''' <summary>
        ''' Gets or sets the radio button skinID
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker Skins"), Bindable(True)> _
        Public Property RadioButtonSkinID() As String
            Get
                Return RbtnShowTo.SkinID
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                RbtnShowTo.SkinID = value
            End Set
        End Property

        ''' <summary>
        ''' Gets or sets the Add button SkinID
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker Skins"), Bindable(True)> _
        Public Property AddButtonSkinID() As String
            Get
                Return btnAdd.SkinID
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                btnAdd.SkinID = value
            End Set
        End Property

        ''' <summary>
        ''' Gets or sets the Remove Button SkinID
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker Skins"), Bindable(True)> _
        Public Property RemoveButtonSkinID() As String
            Get
                Return btnRemove.SkinID
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                btnRemove.SkinID = value
            End Set
        End Property

        ''' <summary>
        ''' Gets or sets the Left List Box SkinID
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker Skins"), Bindable(True)> _
        Public Property LeftListSkinID() As String
            Get
                Return lbxLeftList.SkinID
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                lbxLeftList.SkinID = value
            End Set
        End Property

        ''' <summary>
        ''' Gets or sets the Right List Box SkinID
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker Skins"), Bindable(True)> _
        Public Property RightListSkinID() As String
            Get
                Return lbxRightList.SkinID
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                lbxRightList.SkinID = value
            End Set
        End Property

        ''' <summary>
        ''' Gets or sets the Left List Heading SkinID
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker Skins"), Bindable(True)> _
        Public Property LeftListHeadingSkinID() As String
            Get
                Return lblLeftListHeading.SkinID
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                lblLeftListHeading.SkinID = value
            End Set
        End Property

        ''' <summary>
        ''' Gets or sets the Right List Heading SkinID
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property RightListHeadingSkinID() As String
            Get
                Return lblRightListHeading.SkinID
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                lblRightListHeading.SkinID = value
            End Set
        End Property
#End Region


        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property RadioButtonShowToAllText() As String
            Get
                Return RbtnShowTo.Items.FindByValue(1).Text
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                RbtnShowTo.Items.FindByValue(1).Text = value
            End Set
        End Property

        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property RadioButtonShowToSpecificText() As String
            Get
                Return RbtnShowTo.Items.FindByValue(0).Text
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                RbtnShowTo.Items.FindByValue(0).Text = value
            End Set
        End Property

        ''' <summary>
        ''' gets or sets the direction that the radio buttons are displayed
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property RadioButtonRepeatDirection() As RepeatDirection
            Get
                Return RbtnShowTo.RepeatDirection
            End Get
            Set(ByVal value As RepeatDirection)
                EnsureChildControls()
                RbtnShowTo.RepeatDirection = value
            End Set
        End Property

        ''' <summary>
        ''' Gets or sets the heading text of the left list
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property LeftListHeadingText() As String
            Get
                Return lblLeftListHeading.Text
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                lblLeftListHeading.Text = value
            End Set
        End Property

        ''' <summary>
        ''' Gets or sets the heading text of the right list
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property RightListHeadingText() As String
            Get
                Return lblRightListHeading.Text
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                lblRightListHeading.Text = value
            End Set
        End Property

        ''' <summary>
        ''' The text displayed on the Add button
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property AddButtonText() As String
            Get
                Return btnAdd.Text
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                btnAdd.Text = value
            End Set
        End Property

        ''' <summary>
        ''' The text displayed on the Remove button
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property RemoveButtonText() As String
            Get
                Return btnRemove.Text
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                btnRemove.Text = value
            End Set
        End Property


        ''' <summary>
        ''' Populates / Gets the status of the Radio button with either None Selected; Show to all; or Show To Specific
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property ShowTo() As ShowToOptions
            Get
                If ShowRadioButtons = False Then
                    Return ShowToOptions.ShowToSpecific
                Else
                    Select Case RbtnShowTo.SelectedValue
                        Case ""
                            Return ShowToOptions.NoneSelected
                        Case 1
                            Return ShowToOptions.ShowToAll
                        Case 0
                            Return ShowToOptions.ShowToSpecific
                    End Select
                End If
            End Get
            Set(ByVal value As ShowToOptions)
                EnsureChildControls()
                Select Case value
                    Case ShowToOptions.NoneSelected
                        RbtnShowTo.SelectedValue = Nothing
                        rowMainArea.Visible = False
                        rowHeaderLabels.Visible = False
                    Case ShowToOptions.ShowToAll
                        RbtnShowTo.SelectedValue = ShowToOptions.ShowToAll
                        rowMainArea.Visible = False
                        rowHeaderLabels.Visible = False
                    Case ShowToOptions.ShowToSpecific
                        RbtnShowTo.SelectedValue = ShowToOptions.ShowToSpecific
                        rowMainArea.Visible = True
                        rowHeaderLabels.Visible = True
                End Select
            End Set
        End Property


        '''' <summary>
        '''' Shows or hides the radio buttons. If ShowRadioButton is false then the ShowTo Property will return ShowToSpecific
        '''' </summary>
        '''' <value></value>
        '''' <returns></returns>
        '''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property ShowRadioButtons() As Boolean
            Get
                Return rowRadioButtons.Visible
            End Get
            Set(ByVal value As Boolean)
                EnsureChildControls()
                rowRadioButtons.Visible = value

            End Set
        End Property

        ''' <summary>
        ''' Turns the CausesValidation property of for when you click the Add and remove buttons so that any other validators on the page do not fire
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property CausesValidation() As Boolean
            Get
                Return btnAdd.CausesValidation
            End Get
            Set(ByVal value As Boolean)
                EnsureChildControls()
                btnAdd.CausesValidation = value
                btnRemove.CausesValidation = value
            End Set
        End Property

        ''' <summary>
        ''' The Collection of information that is to be placed into the Left List
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property LeftCollection() As Object
            Get
                Dim MyObj As Object = ViewState("LeftCollection")
                If IsNothing(MyObj) Then
                    Return Nothing
                Else
                    Return MyObj
                End If
            End Get
            Set(ByVal value As Object)
                EnsureChildControls()
                ViewState("LeftCollection") = value
            End Set
        End Property

        ''' <summary>
        ''' The Collection of information that is to be placed into the Right List
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property RightCollection() As Object
            Get
                Dim MyObj As Object = ViewState("RightCollection")
                If IsNothing(MyObj) Then
                    Return Nothing
                Else
                    Return MyObj
                End If
            End Get
            Set(ByVal value As Object)
                EnsureChildControls()
                ViewState("RightCollection") = value
            End Set
        End Property

        ''' <summary>
        ''' A field name which defines the Left Collection data Value which is placed in the list box (Normally the ID field)
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property LeftCollectionDataValueField() As String
            Get
                Return lbxLeftList.DataValueField
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                lbxLeftList.DataValueField = value
            End Set
        End Property

        ''' <summary>
        ''' The field name of the Text displayed in the Left List box
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property LeftCollectionDataTextField() As String
            Get
                Return lbxLeftList.DataTextField
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                lbxLeftList.DataTextField = value
            End Set
        End Property

        ''' <summary>
        ''' A field name which defines the Right Collection data Value which is placed in the list box (Normally the ID field)
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property RightCollectionDataValueField() As String
            Get
                Return lbxRightList.DataValueField
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                lbxRightList.DataValueField = value
            End Set
        End Property

        ''' <summary>
        ''' The field name of the Text displayed in the Right List box
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Category("DoubleListPicker"), Bindable(True)> _
        Public Property RightCollectionDataTextField() As String
            Get
                Return lbxRightList.DataTextField
            End Get
            Set(ByVal value As String)
                EnsureChildControls()
                lbxRightList.DataTextField = value
            End Set
        End Property

#End Region

#Region "Create child controls"

        Protected Overrides Sub CreateChildControls()
            tabLayoutTable = New Table
            tabLayoutTable.ID = "tabLayoutTable"
            'tabLayoutTable.BorderWidth = 1
            tabLayoutTable.SkinID = "DoubleListPicker"
            Me.Controls.Add(tabLayoutTable)

            rowRadioButtons = New TableRow
            rowRadioButtons.ID = "rowRadioButtons"

            cellRadioButtons = New TableCell
            cellRadioButtons.ID = "cellRadioButtons"
            cellRadioButtons.ColumnSpan = 3
            'cellRadioButtons.BorderWidth = 1
            cellRadioButtons.SkinID = "DoubleListPickerRadio"
            rowRadioButtons.Cells.Add(cellRadioButtons)

            rowHeaderLabels = New TableRow
            rowHeaderLabels.ID = "rowHeaderLabels"

            cellLeftHeader = New TableCell
            cellLeftHeader.ID = "cellLeftHeader"
            'cellLeftHeader.BorderWidth = 1
            cellLeftHeader.SkinID = "DoubleListPickerLeftListHeader"
            rowHeaderLabels.Cells.Add(cellLeftHeader)

            cellButtonsHeader = New TableCell
            cellButtonsHeader.ID = "cellButtonsHeader"
            'cellButtonsHeader.BorderWidth = 1
            cellButtonsHeader.SkinID = "DoubleListPickerButtonHeader"
            rowHeaderLabels.Cells.Add(cellButtonsHeader)

            cellRightHeader = New TableCell
            cellRightHeader.ID = "cellRightHeader"
            'cellRightHeader.BorderWidth = 1
            cellRightHeader.SkinID = "DoubleListPickerRightListHeader"
            rowHeaderLabels.Cells.Add(cellRightHeader)

            rowMainArea = New TableRow
            rowMainArea.ID = "rowMainArea"

            cellLeftList = New TableCell
            cellLeftList.ID = "cellLeftList"
            'cellLeftList.BorderWidth = 1
            cellLeftList.SkinID = "DoubleListPickerLeftList"
            rowMainArea.Cells.Add(cellLeftList)

            cellButtons = New TableCell
            cellButtons.ID = "cellButtons"
            'cellButtons.BorderWidth = 1
            cellButtons.SkinID = "DoubleListPickerButtons"
            rowMainArea.Cells.Add(cellButtons)

            cellRightList = New TableCell
            cellRightList.ID = "cellRightList"
            'cellRightList.BorderWidth = 1
            cellRightList.SkinID = "DoubleListPickerRightList"
            rowMainArea.Cells.Add(cellRightList)


            tabLayoutTable.Rows.Add(rowRadioButtons)
            tabLayoutTable.Rows.Add(rowHeaderLabels)
            tabLayoutTable.Rows.Add(rowMainArea)

            'Radio buttons
            RbtnShowTo = New RadioButtonList
            RbtnShowTo.ID = "RbtnShowTo"
            RbtnShowTo.Items.Add(New ListItem("Show to all", "1"))
            RbtnShowTo.Items.Add(New ListItem("Show to specific", "0"))
            RbtnShowTo.AutoPostBack = "true"
            RbtnShowTo.SkinID = ""
            AddHandler RbtnShowTo.SelectedIndexChanged, AddressOf RbtnShowTo_SelectedIndexChanged
            cellRadioButtons.Controls.Add(RbtnShowTo)

            'Left List
            lblLeftListHeading = New Label
            lblLeftListHeading.ID = "lblLeftListHeading"
            lblLeftListHeading.Text = "Available"
            lblLeftListHeading.SkinID = "LeftList"
            cellLeftHeader.Controls.Add(lblLeftListHeading)

            lbxLeftList = New ListBox
            lbxLeftList.ID = "lbxLeftList"
            lbxLeftList.SkinID = "DoubleListPickerLeftList"
            cellLeftList.Controls.Add(lbxLeftList)

            'Right List
            lblRightListHeading = New Label
            lblRightListHeading.ID = "lblRightListHeading"
            lblRightListHeading.Text = "Show to"
            lblRightListHeading.SkinID = "RightList"
            cellRightHeader.Controls.Add(lblRightListHeading)

            lbxRightList = New ListBox
            lbxRightList.ID = "lbxRightList"
            lbxRightList.SkinID = "DoubleListPickerRightList"
            cellRightList.Controls.Add(lbxRightList)

            'Buttons
            btnAdd = New Button
            btnAdd.ID = "btnAdd"
            btnAdd.Text = "Add -->"
            btnAdd.SkinID = "DoubleListPickerAddButton"
            AddHandler btnAdd.Click, AddressOf btnAdd_Click

            cellButtons.Controls.Add(btnAdd)

            litBreak = New Literal
            litBreak.ID = "litBreak"
            litBreak.Text = "<br/>"
            cellButtons.Controls.Add(litBreak)

            btnRemove = New Button
            btnRemove.ID = "btnRemove"
            btnRemove.Text = "<-- Remove"
            btnRemove.SkinID = "DoubleListPickerRemoveButton"
            AddHandler btnRemove.Click, AddressOf btnRemove_Click
            cellButtons.Controls.Add(btnRemove)


        End Sub
#End Region

#Region "Methods"
        Public Sub RbtnShowTo_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
            Select Case RbtnShowTo.SelectedValue
                Case ShowToOptions.NoneSelected
                    rowMainArea.Visible = False
                    rowHeaderLabels.Visible = False
                Case ShowToOptions.ShowToAll
                    rowMainArea.Visible = False
                    rowHeaderLabels.Visible = False
                Case ShowToOptions.ShowToSpecific
                    rowMainArea.Visible = True
                    rowHeaderLabels.Visible = True
            End Select
            'Runs the raiseevent which is where the developer can incorporate their own actions
            RaiseEvent RadioButtonSelectedIndexChanged(sender, e)
        End Sub

        Public Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim TempleftCollection As Object
            TempleftCollection = LeftCollection
            Dim TempRightCollection As Object
            TempRightCollection = RightCollection

            Dim Counter As Integer = 0
            For Each MyLeftDataListItem As ListItem In lbxLeftList.Items
                If MyLeftDataListItem.Selected = True Then
                    TempRightCollection.add(LeftCollection.item(Counter))
                    TempleftCollection.removeAt(Counter)
                Else
                    Counter = Counter + 1
                End If
            Next

            lbxLeftList.DataSource = TempleftCollection
            lbxLeftList.DataBind()

            lbxRightList.DataSource = TempRightCollection
            lbxRightList.DataBind()
            'Runs the raiseevent which is where the developer can incorporate their own actions
            RaiseEvent AddButtonClicked(sender, e)
        End Sub


        Public Sub btnRemove_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim TempleftCollection As Object
            TempleftCollection = LeftCollection
            Dim TempRightCollection As Object
            TempRightCollection = RightCollection

            Dim Counter As Integer = 0
            For Each MyRightDataListItem As ListItem In lbxRightList.Items
                If MyRightDataListItem.Selected = True Then
                    TempleftCollection.add(RightCollection.item(Counter))
                    TempRightCollection.removeAt(Counter)
                Else
                    Counter = Counter + 1
                End If
            Next

            lbxLeftList.DataSource = TempleftCollection
            lbxLeftList.DataBind()

            lbxRightList.DataSource = TempRightCollection
            lbxRightList.DataBind()
            'Runs the raiseevent which is where the developer can incorporate their own actions
            RaiseEvent RemoveButtonClicked(sender, e)
        End Sub







        ''' <summary>
        ''' Loads in the collections into the control. This needs to be run the first time the control is loaded
        ''' </summary>
        ''' <remarks></remarks>
        Sub LoadControlData()
            EnsureChildControls()
            'Load in the left List
            lbxLeftList.DataValueField = Me.LeftCollectionDataValueField
            lbxLeftList.DataTextField = Me.LeftCollectionDataTextField
            lbxLeftList.DataSource = LeftCollection
            lbxLeftList.DataBind()

            'Load in th eright List
            lbxRightList.DataValueField = Me.RightCollectionDataValueField
            lbxRightList.DataTextField = Me.RightCollectionDataTextField
            lbxRightList.DataSource = RightCollection
            lbxRightList.DataBind()



        End Sub
#End Region

        Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
            tabLayoutTable.RenderControl(writer)
        End Sub


    End Class
End Namespace

 
0
Bow99
7/10/2007 8:05:27 AM

Hi,

I changed the property as following and it is working now. The problem was that you were using RadioButtonList for storing the value of ShowTo property. Remember all the child controls in CompositeControl are created every time a property is changed in design time. So the value set by user was getting lost. Use the following code as baseline and improve it to incorporate your logic.

<Category("DoubleListPicker"), Bindable(True)> _
        Public Property ShowTo() As ShowToOptions
            Get
                Return
ViewState("ShowTo")

                If ShowRadioButtons = False Then
                    Return
ShowToOptions.ShowToSpecific
                Else
                    Select Case
RbtnShowTo.SelectedValue
                        Case ""
                            Return ShowToOptions.NoneSelected
                        Case 1
                            Return ShowToOptions.ShowToAll
                        Case 0
                            Return ShowToOptions.ShowToSpecific
                    End Select
                End If
            End Get
            Set
(ByVal value As ShowToOptions)
                EnsureChildControls()
                ViewState("ShowTo") = value
                Select Case value
                    Case ShowToOptions.NoneSelected
                        RbtnShowTo.SelectedValue = Nothing
                        rowMainArea.Visible = False
                        rowHeaderLabels.Visible = False
                    Case
ShowToOptions.ShowToAll
                        RbtnShowTo.SelectedValue = ShowToOptions.ShowToAll
                        rowMainArea.Visible = False
                        rowHeaderLabels.Visible = False
                    Case
ShowToOptions.ShowToSpecific
                        RbtnShowTo.SelectedValue = ShowToOptions.ShowToSpecific
                        rowMainArea.Visible = True
                        rowHeaderLabels.Visible = True
                End Select
            End Set
        End Property

 
- Sujit

Dont forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
0
sujitm
7/10/2007 9:09:32 AM
Reply:

Similar Artilces:

''''''''''''''''''''
Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/1.7.2.0 GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

'''''
Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

Error Creating Control MyControl:'False' could not be set on property 'CausesValidation'
Hi all! I wrote simple CustomControl, its base class is CompositeControl.Control consists of ImageButton and LinkButton. A problem is that when this control is represented in editor in VS only when his property of CausesValidation = true, otherwise the error: Error Creating Control MyControl:'False' could not be set on property 'CausesValidation'. Here is a code:1 [Bindable(true)] 2 [Category("Behavior")] 3 [Description("Whether the button causes validation to fire.")] 4 [Themeable(false)] 5 public bool CausesValidation 6 { 7 get 8 { 9 imgButton.Ca...

Error Creating Control: 'x:NavMenu' could not be set on property 'Tabs'.
I've been banging my head for a while now around this problem... I just wanted to create a menu such as below.<x:menu id="NavMenu" runat="server">    <x:Tab Link="Http://www.google.com/" Text="Online" runat="server"/></x:menu> It works totally fine with the code below but when I view the page in the designer I have problems where it cannot set hte property.I've played around with different [ParseChildren(false)] markings but can't get it right. Maybe some expert can help me.  He...

'do' won't 'do' if '/'
Greetings to All from Au, Have a NetWare Perl 5.8.4 and wanted to tweak File\Spec\NW.pm to try and standardise on '/' separators. If I run a test script (t/uni/lower.t) with an unmodified NW.pm, it calls t/uni/case.pl, that, in case.pl, (when the path separators are '\'), the $file is '..\lib\unicore\To\Lower.pl' and the following code portion works, with $simple getting a returned table: sub casetest { my ($base, $spec, $func) = @_; my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "lib", &qu...

'''
Name: L Lachowsky Email: e2brutus_10atyahoodotcom Product: Firefox Summary: ''' Comments: why duddn this surprise me... I change default server from IE to Mozilla, and then i get error messages. well, shud I decide to not get on my computer with Mozilla..or shud I risk security breeches with IE....hmmm at least i can get on the internet with IE Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this fee...

Cast from type ''''DBNull'''' to type ''''String'''' is not valid.
How do I avoid getting this error: Cast from type ''''DBNull'''' to type ''''String'''' is not valid. I am trying to get values from the database into a form for updating using a Datareader, SQL is set to allow nulls for certain fields as they are not required but the only way I can get the form to display is by adding a space in SQL. Is there another way around this? Check if it is equal to DBNull.Value first and if it is, don't do the cast.Stanley Tan theSpoke Blog Where in the code does it need to go? I am using the following and it's the profile that isn't always requi...

'IN' Clause or 'OR'
Hello, [1]: select * from TABLEA where COL1 IN('value1','value2''valu3'....) [2]:select * from TABLEA where COL1 = 'value1' OR COL1= 'value2' OR COL1='valu3'. TABLEA is a huge table and it has non-clustered index on COL1. Among the above 2 queries, which query will give me the better performance or fast response and WHY? What is the difference between 'IN' and 'OR' clauses as for as Sybase Optimization is concerned. Which is the better one to be used on huge tables. Thanks. Mac An IN list is treated ...

'b'..'a'
Hello. I'm using defferent 5.6.0's for Win32. I wonder wheter following behaviour is intentional or not: d:\>perl -e "print 'b'..'c'" bc d:\>perl -e "print 'b'..'a'" bcdefghijklmnopqrstuvwxyz I expected empty list in latter case, like in perl -e "print 'bb'..'a'" <!ENTITY Vadim REALLIFE "Vadim V.Konovalov, St.Petersburg, Russia"> &Vadim; On Wed, Sep 20, 2000 at 03:14:41PM +0400, Konovalov, Vadim wrote: > Hello. > > I'm using defferent 5.6.0'...

'or' or 'union'
Hello I was just wondering, in general what is better to use, an 'or' clause in a select or a 'union' to join two selects together. Do both statements create work tables? Many thanks Alex I think OR will be better than union. because suppose u have 3 tables and using OR u can join table a and table b and table c so each table will have only one read. but using union you will join table a and table b and in another query of union u will use table (a or b) and table c so ur one read is more in union . Ramdas Alex Cheung wrote: > Hello > >...

'True' could not be set on property 'IsUsed'
I have developed a custom control, which has a property called IsUsed. when im in the aspx page, i try to set a value for that property i get this error: there was an error rendering the control:'True' could not be set on property 'IsUsed' can you help pleas thanks You'll need to post some relevant code....

Could not find control '' in ControlParameter ''
Hello All I have a repeater with controls, some draw from different SqlDatasources. Everything loads up properly, I click my update button and then I get the error: "Could not find control 'txtProjectName' in ControlParameter 'projectName'" The Control txtProjectName is in the repeater <itemTemplate> <asp:TextBox ID="txtProjectName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "projectName") %>' /> My Datasource that I want to update looks like this:  <asp:SqlDataSource ID="dsEditProject" runat="server" ConnectionString="<%$ ConnectionString...

'' could not be set on property 'UserInfos'
Edited by SomeNewKid. Please post code between <code> and </code> tags. I have a control that has a property of type collection. When I add the control to the page and add couple of items to collection property it runs fine with no problem. When I exit Visual Studio.NET and get back again the control's tag has error message Error Creating Control with tooltip saying " '' could not be set on property 'UserInfos' " how ever page still runs fine, but the problem is when tag has an error I can no longer edit its properties in property panel. If you have any i...

error in ''%'' operator
hi... friends    i got this error (Syntax error: Missing operand after ''%'' operator)below statement. dtBtnScr.DefaultView.RowFilter = "LOCATION_CITY'" + txtCity.Text.Trim() + "%'AND LOCATION_STATE '" + ddlState.SelectedValue + "%'AND UNIT_ID'" + txtUnitCode + "%'AND UNIT_NAME '" + txtUnitName.Text.Trim() + "%'";   thnax friends It thinks you are trying to use the modulo operator: %. Look at the RowFilter string after you build it ...you should see the prob...

Web resources about - 'Error Creating Control' ... 'true' could not be set on property 'ShowRadioButtons' - asp.net.custom-server-controls

Resources last updated: 12/15/2015 3:22:49 AM