PerformBatchUpdate missing pending changes under IE8 Native

4 replies. Last post: March 23, 2011 10:09 AM by Guillermo Montes
Tags :
  • New Discussion
  • New Question
  • New Product Feedback

Hi,

We're having this issue with the PerformBatchUpdate method and the PendingChanges collection, we're not getting any changes in the BatchUpdate event.

This is happening with:

- VS 2010

- Any page using a Master page

- IE8 Native

To reproduce this I created a new Web Application project in VS 2010 (that gives me the master) and overwrote the Default.aspx page with this;

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="TestControls2010._Default" %>
<%@ Register Assembly="ISNet.WebUI.WebGrid" Namespace="ISNet.WebUI.WebGrid" TagPrefix="ISNet" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <ISNet:WebGrid id="webGrid1" runat="server" Height="250px" Width="500px" UseDefaultStyle="true" DefaultStyleMode="Elegant"
     OnInitializeDataSource="webGrid1_InitializeDataSource" OnBatchUpdate="webGrid1_BatchUpdate">
        <LayoutSettings AllowBatchUpdate="true" AllowEdit="Yes" AllowAddNew="Yes" />
        <RootTable>
            <Columns>
                <ISNet:WebGridColumn Name="ID" DataMember="key" />
                <ISNet:WebGridColumn Name="Name" DataMember="value" />
            </Columns>            
        </RootTable>
    </ISNet:WebGrid>
    <br />
    <asp:Button ID="btnBatchUpdate" runat="server" Text="Do Batch Update" OnClick="btnBatchUpdate_Click" />
</asp:Content>

 

Here's my cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ISNet.WebUI.WebGrid;
namespace TestControls2010
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void btnBatchUpdate_Click(object sender, EventArgs e)
        {
            webGrid1.PerformBatchUpdate(false);
        }
        protected void webGrid1_InitializeDataSource(object sender, DataSourceEventArgs e)
        {
            var listkvp = new List<KeyValuePair<string, string>>() { 
                new KeyValuePair<string, string>("1", "Canada"),
                new KeyValuePair<string, string>("2", "China"),
                new KeyValuePair<string, string>("3", "Croatia")
            };
            e.DataSource = listkvp;
        }
        protected void webGrid1_BatchUpdate(object sender, BatchUpdateEventArgs e)
        {
            var count = e.PendingChanges.Count;
        }
    }
}

 


After adding a record to the grid, I'm triggering the BatchUpdate event by calling webGrid1.PerformBatchUpdate() from a button click event... as you can see in the screenshots the BatchUpdateEventArgs.PendingChanges collection is empty. Is there something I can configure to get this working?


Finally, this is not the case if I use compatibility view or the batch update controls (the blue check button to commit changes), but using those are not an option... the controls are even hidden in our production instances of the grid.


Thanks,

Guillermo Montes

All times are GMT -5. The time now is 10:53 PM.
Previous Next