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
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.
Hello,Could you please provide me a simple sample that replicate your issue?So I can help you to investigate your issue on my end.Thank you.Regards,Hans.
Hello,Thank you for your information.I made a simple sample to demonstrate how to hide and show WebGrid column from client side.I bind the WebGrid to access data source (Northwind.mdb database & Shippers table).In my sample, I try to hide\show Phone column using WebButton’s OnClientClick client side event.Here’s the snippet code in OnClientClick:
function WebButton1_OnClientClick(controlId, parameter) { var WebButton1 = ISGetObject(controlId); var WebGrid1 = ISGetObject("WebGrid1"); if (!WebGrid1.RootTable.Columns.GetNamedItem("Phone").Visible) { WebGrid1.RootTable.Columns.GetNamedItem("Phone").Visible = true; WebGrid1.RootTable.Columns.GetNamedItem("Phone").Show(); } else { WebGrid1.RootTable.Columns.GetNamedItem("Phone").Visible = false; WebGrid1.RootTable.Columns.GetNamedItem("Phone").HideFromView(); } return true; }
However, if you want to make any changes to your Webgrid’s column, for example adding new columns, the structure is changed and could not be modified easily without fullpostback.In my humble opinion, I recommended you to handle all your WebGrid’s changes using fullpostback event. So you could easier to handle all your WebGrid’s changes.I attached my sample as well. Please have review on my sample.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.
function WebGrid1_OnAfterResponseProcess(controlId, actionName, lastRequestObject, xmlResponseObject) { var WebGrid1 = ISGetObject(controlId); if (actionName == "DeleteRow") { var childRowsLenght = lastRequestObject.GetParentRow().GetChildRows().length; // if there is no child row any more if (childRowsLenght == 0) { // we need to refresh the WebGrid to apply the ChildRowEmptyAction property WebGrid1.Refresh(); } } return true; }
Also “RestoreExpandedChildRows” property to “True” and “RestoreRowSelection” to “All”.Hope this helps.Regards,Hans.
function WebGrid1_OnColumnResize(controlId, tblName, column, width) { var WebGrid1 = ISGetObject(controlId); var ShipperIDColumn = document.getElementById("ShipperIDColumn"); var CompanyNameColumn = document.getElementById("CompanyNameColumn"); var PhoneColumn = document.getElementById("PhoneColumn"); var ShipperIDWidth = document.getElementById("ShipperIDWidth"); var CompanyNameWidth = document.getElementById("CompanyNameWidth"); var PhoneWidth = document.getElementById("PhoneWidth"); // To save the new width if (column.DataMember == ShipperIDColumn.value) { ShipperIDWidth.value = width; } else if (column.DataMember == CompanyNameColumn.value) { CompanyNameWidth.value = width; } else { PhoneWidth.value = width; } // To post back WebGrid1.RefreshAll(); return true; }
Then I made some validation in InitializeColumn server side event, to apply the new width. Here the snippet code:
protected void WebGrid1_InitializeColumn(object sender, ISNet.WebUI.WebGrid.ColumnEventArgs e) { // To set ShipperID Column if (ShipperIDColumn.Value == e.Column.DataMember && ShipperIDWidth.Value != "") { string newWidth = ShipperIDWidth.Value; int intNewWitdh = Int32.Parse(newWidth); e.Column.Width = System.Web.UI.WebControls.Unit.Pixel(intNewWitdh); } // To set CompanyName Column else if (CompanyNameColumn.Value == e.Column.DataMember && CompanyNameWidth.Value != "") { string newWidth = CompanyNameWidth.Value; int intNewWitdh = Int32.Parse(newWidth); e.Column.Width = System.Web.UI.WebControls.Unit.Pixel(intNewWitdh); } // To set Phone Column else if (PhoneColumn.Value == e.Column.DataMember && PhoneWidth.Value != "") { string newWidth = PhoneWidth.Value; int intNewWitdh = Int32.Parse(newWidth); e.Column.Width = System.Web.UI.WebControls.Unit.Pixel(intNewWitdh); } }
I attached my sample as well. Please have a review on my sample and let me hear your response.Thank you.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.
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