How to pass parameter in RadclientDatasource Select Url

5 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. UI for ASP.NET Ajax is Ready for VS 2017
  4. 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.
  5. 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

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

    Posted 13 May Link to this post

    I have your same problem!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017