How to pass parameter in RadclientDatasource Select Url

7 posts, 0 answers
  1. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 09 Feb 2015 Link to this post

    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
  2. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 10 Feb 2015 Link to this post

    Hi,

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


    Thanks,
  3. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 11 Feb 2015 in reply to Dhamodharan Link to this post

    Hi Telerik Team,

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


    Thanks in Advance,
    Dhamu.
  4. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 12 Feb 2015 in reply to Dhamodharan Link to this post

    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

  5. Gioce90
    Gioce90 avatar
    16 posts
    Member since:
    Nov 2015

    Posted 13 May 2016 Link to this post

    I have your same problem!
  6. Prathibarani
    Prathibarani avatar
    55 posts
    Member since:
    Mar 2013

    Posted 09 May 2018 in reply to Dhamodharan Link to this post

    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

  7. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4944 posts

    Posted 10 May 2018 Link to this post

    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.
Back to Top