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
My grid has a childtable. One cell in the row is a button. How do I get the value of cell(1) of the row whose button is clicked.
You can use AddInput method to pass the values on server. To do this, please set AutoPostback true on WebGridButton and add the following codes:
function WebGrid1_OnButtonClick(controlId, tblName, colName, cellValue) { var WebGrid1 = ISGetObject(controlId); var selObj=WebGrid1.GetSelectedObject(); var rowObj=selObj.ToRowObject(); var cellObj=rowObj.GetCells(); WebGrid1.AddInput("cellValue", cellObj[1].Value); return true; }
C# protected void WebGrid1_InitializePostBack(object sender, ISNet.WebUI.WebGrid.PostbackEventArgs e) { if (e.Action == "ButtonClick") { string cellValue = Request.Form["cellValue"].ToString(); WebGrid1.ClientAction.Alert(cellValue); } }
Hope this helps
You can use GetSelectedObject method and Get the specific Cells you need.
e.g
function WebGrid1_OnButtonClick(controlId, tblName, colName, cellValue) { var WebGrid1 = ISGetObject(controlId); var selObj=WebGrid1.GetSelectedObject(); var rowObj=selObj.ToRowObject(); var cellObj=rowObj.GetCells(); alert(cellObj[1].Value); return true; }
Regards,Handy
Handy,Thanks for your answer, I need to do this on the server, because I'm passing those values to a stored proc.
This would be so much easier if there was a Webgrid.rows.CurrentRow or SelectedRow
Handy can you attach a sample with serverside code. I also need to be able to launch a dialog window on button click.
Attachment is my sample which will show the dialog you need. Hope this helps.
Handy,Thanks for the attachment. Please recompile it for WebGrid 7 SP1. When I opened it, it replaced my dlls and I had to repair my installation. Thanks again!
George,
But i only attached .aspx and .aspx.cs. I never heard that this could affect your installation. In fact, i am also using SP1.
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