Hey Peeps,
I have a bit of a problem here. I'm trying to populate a RadComboBox using a web service. It's working as expected however, some combo boxes needs to be populated dynamically. Basically I have three combo boxes on a page. The first combo box is populated using the standard ASP SqlDataSource object. The second combo box needs to be populated according to the selection of the first combo box and the third combo box needs to be populated according to the first and second combo box selections. All three combo boxes have their 'CheckBoxes' property set to true (multi selection required across all three combo boxes). I can manage the first two combo boxes using the SqlDataSource however I need to have something like the EnableLoadOnDemand function on the third combo box. If the client has selected ALL categories on the first combo box and ALL categories on the second combo box, then the third combo box will need to be populated with all available products (+/- 123 000 records). In a normal scenario using the SqlDataSource it takes a very long time to populate. I'm trying to find a way that will reduce loading time.
How do you suggest I approach this situation? What I've done so far is to create a web service to handle the data, but I need to specify the categories and sub categories so that the products are filtered correctly. Is there a way to refresh the web service on the combo box so that these items are populated correctly? (calling DataBind() does not affect the combo box when the LoadOnDemand is set to true).
The control:
In the code-behind I'm trying to re-assign the web service settings:
But with the above coding, the page returns an error 'Object reference not set to an instance of an object'. If I remove the coding, then the service populates nothing (because I'm not setting any values into the web service to retrieve categories from). When I don't set the <WebServiceSettings> into the control, and assign it in the code-behind, then the same error is shown.
Any solutions or suggestions will be greatly appreciated!
I have a bit of a problem here. I'm trying to populate a RadComboBox using a web service. It's working as expected however, some combo boxes needs to be populated dynamically. Basically I have three combo boxes on a page. The first combo box is populated using the standard ASP SqlDataSource object. The second combo box needs to be populated according to the selection of the first combo box and the third combo box needs to be populated according to the first and second combo box selections. All three combo boxes have their 'CheckBoxes' property set to true (multi selection required across all three combo boxes). I can manage the first two combo boxes using the SqlDataSource however I need to have something like the EnableLoadOnDemand function on the third combo box. If the client has selected ALL categories on the first combo box and ALL categories on the second combo box, then the third combo box will need to be populated with all available products (+/- 123 000 records). In a normal scenario using the SqlDataSource it takes a very long time to populate. I'm trying to find a way that will reduce loading time.
How do you suggest I approach this situation? What I've done so far is to create a web service to handle the data, but I need to specify the categories and sub categories so that the products are filtered correctly. Is there a way to refresh the web service on the combo box so that these items are populated correctly? (calling DataBind() does not affect the combo box when the LoadOnDemand is set to true).
The control:
<
telerik:RadComboBox
ID
=
"cboSubCategories"
runat
=
"server"
EmptyMessage
=
"Select"
AutoPostBack
=
"true"
OnSelectedIndexChanged
=
"cboSubCategories_SelectedIndexChanged"
AllowCustomText
=
"true"
Enabled
=
"false"
CheckBoxes
=
"true"
EnableCheckAllItemsCheckBox
=
"true"
EnableLoadOnDemand
=
"false"
EnableItemCaching
=
"true"
Width
=
"324px"
>
<
WebServiceSettings
Path
=
"ComboBoxWebService.asmx"
Method
=
"GetSubCategories"
></
WebServiceSettings
>
</
telerik:RadComboBox
>
In the code-behind I'm trying to re-assign the web service settings:
string
[] serviceInputArray = checkedValues.Split(
';'
);
ComboBoxWebService service =
new
ComboBoxWebService();
service.SetSubCategoryValues(serviceInputArray);
cboSubCategories.Enabled =
true
;
cboSubCategories.EnableLoadOnDemand =
true
;
But with the above coding, the page returns an error 'Object reference not set to an instance of an object'. If I remove the coding, then the service populates nothing (because I'm not setting any values into the web service to retrieve categories from). When I don't set the <WebServiceSettings> into the control, and assign it in the code-behind, then the same error is shown.
Any solutions or suggestions will be greatly appreciated!