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
How can I add/Delete row to/from a WebGrid with client event
Hi Gao Xiyin,
Could you kindly go to these thread "http://intersoftpt.com/Community/WebGrid/Two-Grid/", I am pretty sure that the attachment that included and provided by my colleague, is similar to your scenario in here.
I hope it helps. Thank you and have a nice day.
Best Regards,
Andi Santoso
Hi Gao Yixin,
To delete a row in WebGrid you can use these following snippet:
function Button1_onclick() { var grid = ISGetObject("WebGrid1"); var row = grid.GetSelectedObject().ToRowObject(); row.Delete(); return true; }
To add a row, actually, we will need to insert a default value to our new rows in WebGrid. Here is the snippet:
function Button2_onclick() { var grid = ISGetObject("WebGrid1"); var newRowElement = grid.RootTable.GetNewRow(); var newRow = grid.RootTable.ToRowObject(newRowElement); newRow.Select(); var cells = newRow.GetCells(); cells.GetNamedItem("OrderID").SetText("10248", true); cells.GetNamedItem("ProductID").SetText("42", true); cells.GetNamedItem("UnitPrice").SetText("1", true); cells.GetNamedItem("Quantity").SetText("10", true); cells.GetNamedItem("Discount").SetText("0.05", true); newRow.SetDataChanged(); grid.MarkEdit(); return true; }
hi,Andi ,
thank you for repling,I want to know how can do these two methods when I click a button.for example:
these are two grid:grid1,grid2.The selected row of grid1will be delete from grid1 and add to grid2 when I click a button!
yixin Gao
Hi,Andi
thank you
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