New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

ClientDataSource Object - remove()

Updated on Oct 24, 2025

Removes the data item from the data source with the specified model ID.

ParametersDescription
IDThe model ID of the data item which should be removed.
ASPNET
<telerik:RadClientDataSource runat="server" ID="RadClientDataSource1">
    <DataSource>
        <WebServiceDataSourceSettings ServiceType="OData">
            <Select Url="https://demos.telerik.com/aspnet-ajax/Services/SampleODataService.svc/Products" />
        </WebServiceDataSourceSettings>
    </DataSource>
    <Schema>
        <Model ID="ProductID"></Model>
    </Schema>
</telerik:RadClientDataSource>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="buttonClick(); return false;" />
JavaScript
<script type="text/javascript">
    var dataSource;
    function pageLoad() {
        dataSource = $find('<%= RadClientDataSource1.ClientID %>');
        dataSource.fetch();
    }
    function buttonClick() {
        var data = dataSource.view();
        alert(data.length);  // displays "12"
        alert(data[0].ProductName); // displays "Chai"

        dataSource.remove("1");

        data = dataSource.view();
        alert(data.length);  // displays "11"
        alert(data[0].ProductName); // displays "Chang"
    }
</script>
Not finding the help you need?
Contact Support