Populating Combobox in FormCreating

2 posts, 0 answers
  1. AName
    AName avatar
    13 posts
    Member since:
    Jul 2013

    Posted 11 Dec 2013 Link to this post

    Hi there,

    I am attempting to populate a combo box within a panel when the RadScheduler form Creating method is called.

    if i walk through the code i can see the process hitting the breakpoint however when the combo box is displayed it is blank.


        Protected Sub RadScheduler1_FormCreating(ByVal sender As Object, ByVal e As SchedulerFormCreatingEventArgs)

            If e.Mode = SchedulerFormMode.Insert Then

                e.Cancel = True

            ElseIf e.Mode = SchedulerFormMode.Edit Then

                e.Cancel = True

                ScriptManager.RegisterStartupScript(Page, [GetType](), "formScript", "Sys.Application.add_load(openForm);", True)

                PopulateEditForm()

                formRSUpdate_tbMessage.Text = "This doesnt get set either!"

            End If

        End Sub


        Private Sub PopulateEditForm()

            ComboUtils.FillComboBox1(formRSUpdate_ComboBox1)

        End Sub


    Within my aspx i have the following...

    <telerik:RadDock runat="server" ID="RadDock1" Width="350px" Height="220px" Closed="true" Style="z-index: 2000;" Title="Edit Appointment">

    <Commands>

    <telerik:DockCloseCommand></telerik:DockCloseCommand>

    </Commands>

    <ContentTemplate>

    <asp:Panel ID="PanelDock" runat="server">

    ...

    ...

    <td style="text-align: left">

        <telerik:RadComboBox ID="formRSUpdate_ComboBox1" runat="server" AutoPostBack="True" Width="220px" />

    </td>


    The auto postback is set to true because this is the first of two cascading combo boxes.

    The selection within this combo box drives the population of the second.

    If i use a sqldatasource, I can populate Combox1, and combox2 successfully populates.

    However since i need to drive both on the specific appointment i would like to keep

    everything within the code behind.

    This also does not get set.

    formRSUpdate_tbMessage.Text = "This doesn't get set either!"







    Can you please help?  I am trying to populate a bunch of controls within the form from the appointment.

  2. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 16 Dec 2013 Link to this post

    Hello,

    I tried to replicate the faced issue, base on the provided code snippets and information, but to no avail. I noticed that you are populating the RadComboBox using - ComboUtils.FillComboBox1(formRSUpdate_ComboBox1). Could you demonstrate us the logic and code in the Class? In addition, I am sending you a sample project, base on the provided code snippets, demonstrating the correct population with data of the RadComboBox.

    Regards,
    Nencho
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top