This is a migrated thread and some comments may be shown as answers.

Setting Selected Value Programically on Multiple RadComboBoxes and getting an ERROR when Submitting

1 Answer 47 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Brandon asked on 07 Jan 2011, 06:33 PM
I am trying to click a submit button after loading and pre-populating and pre-selecting a value of two radcomboboxes.

If I try it with this code: (the setting for the second radcombobox is: EnableAutomaticLoadOnDemand="True" )

<tr>
                    <td colspan="2"> <b> Supervisor Name </b></td>
                    <td colspan="3">
                        <asp:HiddenField ID="CRAFT_CODE_Textbox" runat="server" value="H" />
                        <asp:HiddenField ID="SUPV_ID_TextBox" runat="server" />
                        <br />
                        <telerik:RadComboBox ID="wcOfficerName" Runat="server" 
                            DataSourceID="sdsOfficer" DataTextField="FULL_NAME" 
                            DataValueField="SUPV_ID" EnableAutomaticLoadOnDemand="False" 
                            EnableItemCaching="True" EnableLoadOnDemand="False" 
                            EnableVirtualScrolling="False" Filter="StartsWith" ItemsPerRequest="-1" 
                            MarkFirstMatch="False" Width="279px" ShowMoreResultsBox="False" 
                            Skin="Office2007" LoadingMessage="Loading Please Wait..." EmptyMessage="Please Select Supervisor">
                        </telerik:RadComboBox>
                    </td>
                    </tr>
                    <tr>
                    <td colspan="2"> <b> Employee Name</b></td>
                    <td colspan="3">
                        <asp:HiddenField ID="EMPL_ID_TextBox" runat="server" />
                        <br />                   
                        <telerik:RadComboBox ID="wcEmployeeName" Runat="server" 
                            DataSourceID="sdsEmployees" DataTextField="FULL_NAME" 
                            DataValueField="PERSON_ID" EnableAutomaticLoadOnDemand="True" 
                            EnableItemCaching="True" EnableLoadOnDemand="False" 
                            EnableVirtualScrolling="False" Filter="StartsWith" ItemsPerRequest="-1" 
                            MarkFirstMatch="False" Width="279px" ShowMoreResultsBox="False" 
                            Skin="Office2007" LoadingMessage="Loading Please Wait..." EmptyMessage="Please Select Employee">
                        </telerik:RadComboBox>
                       <br />
                    </td>
                </tr>
It works.

However if I change the second radcombobox setting to EnableAutomaticLoadOnDemand="False"  then it errors out when I click the "submit" button.

For the error please see attached "error.jpg"

To set the selectedvalue of each rad box I use the following code in the page load event:
Me.wcEmployeeName.SelectedValue = dataset.Tables(0).Rows(0)(4)
 Me.wcOfficerName.SelectedValue = dataset.Tables(0).Rows(0)(3)

Please help!

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 10 Jan 2011, 11:01 AM
Hello Brandon,

The code and the screenshot do not provide enough information to determine the cause of the error.

Could you provide a live URL and/or the complete code-behind of your page?

Greetings,
Simon
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
ComboBox
Asked by
Brandon
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or