[Solved] Can the last page of records be programitacallyn deleted using JavaScript in RadListView?

0 Answers 5 Views
ListView
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
SUNIL asked on 29 Apr 2026, 10:19 PM | edited on 29 Apr 2026, 11:07 PM

This question relates to ASP.NET RadListView.

I have added records to a RadListView by using the following JavaScript: 

radListView.appendData(data.Data);

 

Everything is done using JavaScript for this RadListView. I now have a new requirement that requires me to remove all the records added during the last appendData call. How would I do this using JavaScript?

The RadListView is template-based and uses the template below.

<LayoutTemplate>
           <div id="items"></div>
           <div id="pagerContainer"></div>
</LayoutTemplate>
<ItemTemplate>
    <div class="recordContainer">
                <div class="subject">#=Subject#</div>
                <div class="message" >#=MessageText#</div>
                <div class="author">#=Author#</div>
    </div>
</ItemTemplate>

 

The way I was going to handle this situation was by keeping track of the number of data items added in the last appendData call. Let's say this number is 20. I would then find the last 20 DOM elements having a class of "recordContainer" and remove those DOM elements. The sample code in jQuery would be as mentioned below, which I haven't tried. However, you might be able to help me figure out a better way to do this, if there is one.

$("div#items div.recordContainer").slice(-20).remove();


No answers yet. Maybe you can help?

Tags
ListView
Asked by
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Share this question
or