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

How to pass parameter in RadclientDatasource Select Url

6 Answers 190 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dhamodharan
Top achievements
Rank 1
Dhamodharan asked on 09 Feb 2015, 07:10 AM
Hi,

I am using RadclientDatasource to bind data unto grid. it is working fine. but i want to pass parameter based on selection. Please check my code and let me know how to pass parameter while selecting and Inserting

<telerik:RadClientDataSource ID="RadClientDataSource1" runat="server" AllowBatchOperations="True">
            <ClientEvents OnCustomParameter="ParameterMap" OnDataParse="Parse" OnRequestFailed="rg_OnRequestFailed" />
            <DataSource>
                <WebServiceDataSourceSettings BaseUrl="/BackStage/BackStageWCFService.svc/">
                    <Select Url="getLocation" DataType="JSON" />                   
                    <Insert Url="InsertLocation" DataType="JSON" />                
                </WebServiceDataSourceSettings>
            </DataSource>
            <Schema>
                <Model ID="att_typ_id">
                    <telerik:ClientDataSourceModelField FieldName="prt_loc_id" DataType="Number" />
                    <telerik:ClientDataSourceModelField FieldName="effective_date" DataType="Date" />
                    <telerik:ClientDataSourceModelField FieldName="termination_date" DataType="String" />
                    <telerik:ClientDataSourceModelField FieldName="rep_loc_code" DataType="String" />
                    <telerik:ClientDataSourceModelField FieldName="rep_loc_id" DataType="Number" />
                    <telerik:ClientDataSourceModelField FieldName="pln_prt_id" DataType="Number" />
                </Model>
            </Schema>
        </telerik:RadClientDataSource>

Javascript
-------------
function ParameterMap(sender, args) {
               
               if (args.get_type() == "read") {                  
                    args.set_parameterFormat({ customersJSON: kendo.stringify(args.get_data().models) });
                }             
            }

Appcode
-------------
<WebGet()> _
<AspNetCacheProfile("NoCache")> _
    Public Function getLocation() As LocationResult
        Dim entities As New EnrollmentEntities()
        Return New LocationResult() With { _
          .Data = entities.PART_REPORTING_LOCATIONS.Where(Function(d) d.PRT_LOC_ID = Here need to pass parameter).ToList().[Select](Function(c) New ServiceLocations() With { _
           .prt_loc_id = c.PRT_LOC_ID, _
           .termination_date = If(HttpUtility.HtmlEncode(c.TERMINATION_DATE) IsNot Nothing, HttpUtility.HtmlEncode(c.TERMINATION_DATE.Value.ToString("MM-dd-yyyy")), ""), _
           .effective_date = c.EFFECTIVE_DATE, _
           .rep_loc_code = HttpUtility.HtmlEncode(c.LEVEL_REP_LOC.REP_LOC_CODE), _
           .rep_loc_id = c.REP_LOC_ID, _
           .pln_prt_id = c.PLN_PRT_ID _
         }).ToList(), _
          .Count = 100 _
        }
    End Function


Please check my code and help ASAP


Thanks in advance,
Dhamu

6 Answers, 1 is accepted

Sort by
0
Dhamodharan
Top achievements
Rank 1
answered on 10 Feb 2015, 07:07 AM
Hi,

can anyone help immediately?. Please this is very urgent for me. Please help


Thanks,
0
Dhamodharan
Top achievements
Rank 1
answered on 11 Feb 2015, 12:45 PM
Hi Telerik Team,

Is support team are available or not? Please respond to my post. It is very very urgent.


Thanks in Advance,
Dhamu.
0
Dhamodharan
Top achievements
Rank 1
answered on 12 Feb 2015, 07:46 AM
Hello Telerik Team,

    I am totally frustrated. Please say whether we can implement clientDataSource or not. i need to inform my higher officials.

Thanks,
Dhamu

0
Gioce90
Top achievements
Rank 1
answered on 13 May 2016, 09:12 AM
I have your same problem!
0
Prathibarani
Top achievements
Rank 1
answered on 09 May 2018, 05:04 PM

Hi,

I am in the same boat. Can you please tell me if it is solved. If yes, can you please provide the code

Thank You

Prathiba

0
Marin Bratanov
Telerik team
answered on 10 May 2018, 01:47 PM
Hello Prathiba,

To add the relevant information from your other thread - the following demo shows how you can add a filter parameter: https://demos.telerik.com/aspnet-ajax/clientdatasource/functionality/filtering/defaultcs.aspx.


Regards,
Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Dhamodharan
Top achievements
Rank 1
Answers by
Dhamodharan
Top achievements
Rank 1
Gioce90
Top achievements
Rank 1
Prathibarani
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or