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,
I'd like to make the grid automatically accept batch update changes. My code is below. From the settings, it seems that it should, but it doens't. I always get the prompt in the status bar to accept pending changes. Everything deletes fine when I accept changes.
<ISWebGrid:WebGrid ID="myGrid" runat="server" Height="560px" Width="100%" UseDefaultStyle="true" EnableWebResources="Always" DataSourceID="odsAccountLineList" CustomSchemaRetrieval="UseWebGrid"> <RootTable GridLineStyle="NotSet" DataKeyField="account_line_id"> </RootTable> <LayoutSettings DisplayDetailsOnUnhandledError="true" InProgressUIBehavior="ChangeCursorToHourGlass" StatusBarVisible="true" NewRowLostFocusAction="AlwaysUpdate" RowLostFocusAction="AlwaysUpdate" AllowColumnMove="Yes" AllowFilter="No" AllowGrouping="No" AllowSelectColumns="Yes" AllowSorting="No" GroupByBoxVisible="false" AutoHeight="false" AutoWidth="true" PagingMode="None" AllowEdit="Yes" AllowDelete="Yes" AllowMultipleSelection="Yes" UseRelativePositioning="true" AllowBatchUpdate="true"> <BatchUpdateSettings AutomaticObjectUpdate="true" AllowReviewChanges="false" AllowUndoChanges="false" NotifyOnLostFocus="false" PromptOnUndoAllChanges="false" PromptUnsavedChanges="false" /> <AlternatingRowStyle CustomRules="text-overflow: ellipsis; overflow-x: hidden" BackColor="LightGray" Wrap="false" Font-Size="8pt" Font-Names="Arial Monospaced"></AlternatingRowStyle> <RowStyle CustomRules="text-overflow: ellipsis; overflow-x: hidden" BackColor="White" Font-Size="8pt" Wrap="false" Font-Names="Arial Monospaced"></RowStyle> <ClientSideEvents OnRowContextMenu="myGrid_OnRowContextMenu" OnColumnContextMenu="myGrid_OnColumnContextMenu" OnAfterInitialize="myGrid_OnAfterInitialize"/> </LayoutSettings> </ISWebGrid:WebGrid>
Thanks.
Hello,Thank you for your code.I’ve made a simple sample using your code. However, I don’t get any prompt when I try to apply changes.I bind WebGrid with access data source control (Northwind.mdb database & Shippers table).Please have a review on my sample & video, then let me hear your response.Regards,Hans.
Hello,I’m glad to hear that you have achieved your goal.Should you have further question, please do not hesitate to contact us.Thank you.Regards,Hans.
Hello,That supposedly doesn’t affect my code.Could you provide me more information about your code/your scenario that you want to achieve?Or could you provide me a simple sample that replicate your issue?Perhaps I can help you to investigate your issue on my end.Thank you.Regards,Hans.
Hello,Basically the type of data source and method parameter doesn’t take any affect to my code. Could you provide a simple sample that replicate your issue? So i can help you investigate this issue further more.I made a another simple to demonstrate how to delete multiple row using button and or context menu. In this sample, I use batch update to True.I use AcceptAllChanges() function to apply all changes without click “Accept All Changes” button in WebGrid.Here this snippet code in WebButton’s OnClientClick client side event:
function WebButton1_OnClientClick(controlId, parameter) { var WebButton1 = ISGetObject(controlId); var WebGrid1 = ISGetObject("WebGrid1"); var checkedRows = WebGrid1.RootTable.GetCheckedRows(); for (var i = 0; i < checkedRows.length; i++) { WebGrid1.RootTable.ToRowObject(checkedRows[i]).Delete(); } WebGrid1.AcceptAllChanges(); return true; }
And I set a validation in WebGrid’s OnAddPendingChanges() client side event:
function WebGrid1_OnAddPendingChanges(controlId, table, rowChange) { var WebGrid1 = ISGetObject("WebGrid1"); if (rowChange.RowState == "Deleted") { window.setTimeout(function () { WebGrid1.AcceptAllChanges(); }, 10); } return true; }
Please have review on my sample. Thank you.Regards,Hans.
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