Updating multiple items in listview updates only first item

2 posts, 0 answers
  1. Jeroen
    Jeroen avatar
    7 posts
    Member since:
    Apr 2011

    Posted 25 May 2011 Link to this post

    I'm trying to update all items in a listview from a single place outside the listview. I've put my simplified code underneath, notice that clicking the button will update only the first item, even though the FireCommandEvent is called for both items in the list.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListViewIssue.aspx.cs"
        Inherits="RadGridSave.ListViewIssue" %>
    <%@ Register Assembly="Telerik.Web.UI, Version=2011.1.413.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
        Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <telerik:RadListView ID="RadListView1" runat="server" AllowMultiItemEdit="true"
        <telerik:RadButton ID="RadButton1" runat="server" onclick="RadButton1_Click"

    using System;
    using System.Collections.Generic;
    using Telerik.Web.UI;
    namespace RadGridSave
        public partial class ListViewIssue : System.Web.UI.Page
            protected void Page_Load(object sender, EventArgs e)
                RadListView1.DataSource = new List<int>() { 1, 2 };
            protected void RadListView1_PreRender(object sender, EventArgs e)
                if (!IsPostBack)
                    foreach (RadListViewDataItem item in RadListView1.Items)
                        item.Edit = true;
            protected void RadButton1_Click(object sender, EventArgs e)
                foreach (var item in RadListView1.EditItems)
                    item.FireCommandEvent(RadListView.UpdateCommandName, string.Empty);
  2. Iana Tsolova
    Iana Tsolova avatar
    3388 posts

    Posted 28 May 2011 Link to this post

    Hi Jeroen,

    Please find the attached sample illustrating how you can implement batch updates with the RadListView control. Give it a try and let me know how it goes.

    Kind regards,
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. DevCraft R3 2016 release webinar banner
Back to Top