Drop down list

Last post 01-03-2012, 9:44 AM by AndyFel. 10 replies.
Sort Posts: Previous Next
  •  12-01-2011, 6:43 AM 71749

    Drop down list

    Hi
     
    I am populating a rich drop list and inserting it into the cuteeditor. However I have a problem in that I am selecting a value in code to be shown but the list always just goes to the first item when its shown.
     
    I have checked out the HTML being output and I can see you have selected the item i want
     
    <span val="4" html="HTML 5" selected="True" txt="HTML 5"></span>
     
    but this is not selected in the drop down list. I know this used to work but we recently updated the editor and since then its not working.
     
    Please can you look into this for me.
     
    Thanks
     
     
  •  12-01-2011, 7:10 AM 71750 in reply to 71749

    Re: Drop down list

    Hi  AndyFel,
     
    The rich drop list mean the css dropdown list of editor? Or the custom dropdown list added by you?
     
    By default editor will only shows the select value which set by our developers, they hard code on that function. Sorry for your inconvenience.
     
    Regards,
     
    Ken 
  •  12-01-2011, 7:15 AM 71751 in reply to 71749

    Re: Drop down list

    .
  •  12-01-2011, 7:26 AM 71752 in reply to 71749

    Re: Drop down list

    Hi  AndyFel,
     
    The rich drop list mean the css dropdown list of editor? Or the custom dropdown list added by you?
     
    By default editor will only shows the select value which set by our developers, they hard code on that function. Sorry for your inconvenience.
     
    Regards,
     
    Ken 
  •  12-01-2011, 7:52 AM 71753 in reply to 71752

    Re: Drop down list

    Hi
     
    Its a custom dropdown list added by me. This used to work fine, but not with the latest code.
    Have pasted the code below.


    Private Sub PopulateDocTypeDropDown()

    'Create dropdown
       Dim container As CuteEditor.ToolControl = Editor1.ToolControls("customddlDocType")
       Dim ddlDocType As CuteEditor.RichDropDownList = New CuteEditor.RichDropDownList(Editor1)
        ddlDocType.CssClass = "CuteEditorDropDown"
        ddlDocType.ToolTip = "Select Document Type (DTD)"
        ddlDocType.ID = "ddlDocType"
        ddlDocType.Width = 120

        'Populate dropdown and set selected value to relevant one
       Dim iCount As Integer = 0
        ddlDocType.Items.Clear()
       Using objRdr As SqlClient.SqlDataReader = SiteDB.SiteGetDocTypeDTD()
          While objRdr.Read()
              ddlDocType.Items.Add(objRdr("Name"), objRdr("ID"))
             If objRdr("ID") = hdnDocType.Value Then
                 ddlDocType.SelectedIndex = iCount
             End If
              iCount += 1
          End While
       End Using
        container.Control.Controls.Add(ddlDocType)
    End Sub
  •  12-02-2011, 6:19 AM 71766 in reply to 71753

    Re: Drop down list

    Hi AndyFel,
     
    Please try the example below, select the "test2" option. Does it still shows the first option on your end?
     
    <%@ Page Language="VB" %>
    <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
        Protected Overrides Sub OnLoad(ByVal e As EventArgs)
            Dim container As CuteEditor.ToolControl = Editor1.ToolControls("insertcustombutonhere")
            If container IsNot Nothing Then
                Dim ddlDocType As New CuteEditor.RichDropDownList(Editor1)
                ddlDocType.CssClass = "CuteEditorDropDown"
                ddlDocType.ToolTip = "Select Document Type (DTD)"
                ddlDocType.ID = "ddlDocType"
                ddlDocType.Width = 120
                ddlDocType.Items.Add(New RichListItem("test1", "test1"))
                ddlDocType.Items.Add(New RichListItem("test2", "test2"))
                container.Control.Controls.Add(ddlDocType)
            End If
            MyBase.OnLoad(e)
        End Sub
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>example</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <CE:Editor ID="Editor1" runat="server">
            </CE:Editor>
        </form>
    </body>
    </html>
     
    Regards,
     
    Ken 
  •  12-16-2011, 8:22 AM 72050 in reply to 71766

    Re: Drop down list

    Hi
    If you place
    ddlDocType.SelectedIndex = 1
     
    after
    ddlDocType.Items.Add(New RichListItem("test2", "test2"))
     
    When the page shows, it should select test2 but it does not.
     
    Is there a way of making test2 show as selected?
     
    thanks
  •  12-18-2011, 6:56 PM 72070 in reply to 71749

    Re: Drop down list

  •  12-19-2011, 5:51 AM 72071 in reply to 72050

    Re: Drop down list

    Hi AndyFel,
     
    Please use DropDownList control
     
    <%@ Page Language="VB" %>

    <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">
     Protected Overrides Sub OnLoad(e As EventArgs)
        Dim container As CuteEditor.ToolControl = Editor1.ToolControls("insertcustombutonhere")
        If container IsNot Nothing Then
            Dim ddl As New DropDownList()
            ddl.Items.Add(New ListItem("test1", "test1"))
            ddl.Items.Add(New ListItem("test2", "test2"))
            ddl.Items.Add(New ListItem("test3", "test3"))
            ddl.CssClass = "CuteEditorDropDown"
            ddl.ToolTip = "Select Document Type (DTD)"
            ddl.ID = "ddl1"
            ddl.Width = 120
            ddl.SelectedIndex = 2
            container.Control.Controls.Add(ddl)
        End If
        MyBase.OnLoad(e)
    End Sub

    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>example</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <CE:Editor ID="Editor1" runat="server">
            </CE:Editor>
        </form>
    </body>
    </html>
     
    Regards,
     
    Ken
  •  12-19-2011, 10:39 AM 72198 in reply to 72071

    Re: Drop down list

    Hi
     
    That works but the dropdown now looks crap.
     
    We have been using the richdropdownlist fine for the last 5 years right up until we last updated the cuteeditor. I have just done a code rollback to test that it used to work fine. Which it did. Ideally it would be nice if you could fix your control to make it work how it used to.
     
    Problem is we cannot roll back the code because then we loose some fixes you have implemented since we last rolled out the cute editor.
     
    Any chance you can make the control work how it used to?
     
    thanks
  •  01-03-2012, 9:44 AM 72490 in reply to 72198

    Re: Drop down list

    Hi
     
    Will you be fixing the richdropdown list back to how it used to work, because i really dont want to have to use the dropdownlist as it looks crap compared to the rich dropdown.
     
    Thanks
View as RSS news feed in XML