iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
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
Hi Lili,
You web.config gave me the answer, thanks for attaching it. If you remove or change the clientIDMode property in your pages directive to "Predictable" (the default), then your example will break as well.
Is it required to have AutoID with .NET 4.0 solutions?
Regards
Hi Guillermo,
I replicated your issue, but the collection worked just fine. Here's I attach the sample I made based on your issue, please check if it is the same with what you mean. I also attach the screen shot of the collection for you.
Regards,
Lili Khiung
I am very glad that the attached sample could help you.
About the last question, I'm terribly sorry I don't really get what you mean. Could you explain in more details? Is the AutoID you mean like the AutoIncrement?
Sure,
In your web.config file, you can specify the ClientIDMode property for the pages element. You should have something like this:
<system.web> ... <pages clientIDMode="AutoID" />
If you don't specify the ClientIDMode property that is by default "Predictable", which is required to break the PerformBatchUpdate() method.
Guillermo
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname