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

Invoke ClientDataSource OnCustomParameter event after changing radcombobox selection

1 Answer 120 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Raeshawn
Top achievements
Rank 1
Raeshawn asked on 20 Nov 2016, 12:11 AM

i'm cascading dropdownbox (radcombobox) with clientdatasource but i'm a having challenges when changing the main combobox in hopes of having oncustomparameter to fire again.

ComboBox

<telerik:RadComboBox runat="server" EmptyMessage="Function" ID="RcbFun" Width="80px" OnClientLoad="Rcb_OnClientLoad" DataTextField="Code" DataValueField="Functions" AppendDataBoundItems="True" ClientDataSourceID="CdsFunc" ItemsPerRequest="15" Filter="Contains"  EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" OnClientSelectedIndexChanged="Rcb_OnClientSelectedIndexChanged"></telerik:RadComboBox>
 
<telerik:RadComboBox runat="server" EmptyMessage="Sub-Function" ID="RcbSubF" Width="80px" OnClientLoad="Rcb_OnClientLoad"  DataTextField="Code" DataValueField="SubFunction" AppendDataBoundItems="True" ClientDataSourceID="CdsSubF" ItemsPerRequest="15" Filter="Contains" HighlightTemplatedItems="true" OnClientSelectedIndexChanged="Rcb_OnClientSelectedIndexChanged" EnableLoadOnDemand="true"></telerik:RadComboBox>

 

 

RadClientDataSource

<telerik:RadClientDataSource ID="CdsFunc" runat="server">
          <DataSource>
              <WebServiceDataSourceSettings BaseUrl="LibraryService.svc/">
                  <Select Url="GetFunctions" DataType="JSON" RequestType="Get" ContentType="application/json; charset=utf-8" />
              </WebServiceDataSourceSettings>
          </DataSource>
          <Schema DataName="d">
          </Schema>
      </telerik:RadClientDataSource>
      <telerik:RadClientDataSource ID="CdsSubF" runat="server">
          <ClientEvents OnCustomParameter="ParamMap" />
          <DataSource>
              <WebServiceDataSourceSettings BaseUrl="LibraryService.svc/">
                  <Select Url="RcbGetSubFunctions" DataType="JSON" RequestType="Get" ContentType="application/json; charset=utf-8" />
              </WebServiceDataSourceSettings>
          </DataSource>
          <Schema DataName="d"></Schema>
      </telerik:RadClientDataSource>

 

OnCustomParameter Method

1.function ParamMap(sender, args) {
2.    if (RcbFun.get_value() != "") {
3.        if (args.get_type() == "read" && args.get_data()) {
4.              args.set_parameterFormat({ paramFunction: RcbFun.get_value() });
5.        }
6.   }
7.}

 

Loading items into RcbSubF after selecting the a value RcbFun for the first time is not a problem. The issues lies in selecting another value in RcbFun. The OnCustomParameter event "ParamMap" will not fire again. Any suggestion? 

Please be advised that these controls are in side a RadPanelBar.

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 23 Nov 2016, 03:33 PM
Hello Raeshawn,

In the described scenario the OnCustomParameter event does not fire again because all ComboBox items are retrieved with the initial request. Since subsequent requests on item selection are not sent to the server the event does not fire.

Regards,
Ivan Danchev
Telerik by Progress
Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
Tags
ComboBox
Asked by
Raeshawn
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or