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
I have a column defined as...
In my BatchUpdate method in the code behind page, I want to access the hiddendatamember field value. How do I access what the value is set to in the HiddenDataMember for that column in the BatchUpdate method in the code behind page?
function WebGrid1_OnRowSelect() { var grid = ISGetObject("WebGrid1"); var getvalue=grid.GetSelectedObject().GetRowObject().GetCells().GetNamedItem("ContactName").GetElement().attributes["CustomerID"].value; window.setTimeout(function() {grid.AddInput("nilai", getvalue); grid.SendCustomRequest(); }, 500); }
C# protected void WebGrid1_InitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e) { WebGrid1.RootTable.Columns.GetNamedItem("ContactName").HiddenDataMember = "CustomerID"; } protected void WebGrid1_InitializePostBack(object sender, ISNet.WebUI.WebGrid.PostbackEventArgs e) { if (e.Action == "Custom") { TextBox1.Text = Request["nilai"].ToString(); WebGrid1.ClientAction.RefreshModifiedControls(); } }
Hope this helps.
Regards,Handy
Thanks, can you please show me some example code of accessing the HiddenDataMember value in the BatchUpdate method server side.
{
}
Hi,
You could not get the value of HiddenDataMember in BatchUpdate server side event.Hidden DataMember is more like attribute. You can set the value of the attribute in the client and if you need to retrieve the value at server, you will need to pass the value from client side into server by using SendCustomRequest(). This method would do response into server and the proper event should be IntializePostBack which I have showed you before.
Dear Handy Surya,
I am working with Jocelyn on this issue.
We are attempting to insert (RowState.Added) a row to a ChildTable in the BatchUpdate method. The WebGridRowChanges contains the "Data" collection with the modified cells for the ChildTable row, but we have found no way to access the KeyValue of the RootTable(Parent) row.
As you can see from the attached image, the rowChanges has a hidden member that contains the parent keyvalue. Is there some way to access this information on the server in the BatchUpdate?
Goal : Get the parent row's keyvalue to use during child row insert (foreign key).
Note : We donot want this value display on the ChildTable.
Hi Jim,
Ok. I understand. I did not know before that your scenario is Hierarchical WebGrid. I will discuss with our developer regarding this issue. Maybe we could find something.
Thanks Handy,
Our team looks forward to hearing your solution.
On a similar note, although we have access to the GetChanges() method of the grid on there server, it seems to only contain information during the BatchUpdate. Is there a way to get this collection on a SendCustomRequest, or the Refresh method? Or is there another method I should be using.
Reason: I need to postback to the server to see all rows of the datasource and do some calculations, but i donot want to persist the data nor loose my change collection at the time of the calculations.
GetChanges() only returns collection of the changed data when using BatchUpdate. Currentlu, it could not retrieve information of parent KeyValue.
After investigated and discussed with our developer teams, it seems the possible workaround to get parentKey value during OnAddPendingChanges client side event. Please see the code below.
function WebGrid1_OnAddPendingChanges(controlId, table, rowChange) { var WebGrid1 = ISGetObject(controlId); var value = rowChange.Row.GetParentRow().KeyValue; WebGrid1.AddInput("parentValue", value); return true; }
e.g I insert a row in child table. I can parent Keyvalue by using rowChange.Row.GetParentRow().KeyValue. Then, I pass this value by using AddInput method.
when I accept all changes, OnBatchUpdate server side event would be raised. To get the value which have been passed from client, we need to make request of "parentValue".
protected void WebGrid1_BatchUpdate(object sender, ISNet.WebUI.WebGrid.BatchUpdateEventArgs e) { string val; val = Request.Form["parentValue"]; }
Handy,
We had found several ways to acquire the ParentKey on the client. The problem still exists that we cannot gain access to it on the server when doing a BatchUpdate.
We had tried the same solution with passing the parentkey in the "AddInput". This works fine if you only update 1 row, but defeats what a "BatchUpdate" stands for. We would need 1 Request.Form input for each Parent row who's child row was changed. Then there is no way to correlate the Request.Form["parentValue" + ???] to the childrow that was changed.
Is there no way to allow us access to the data in the hidden variables from the snapshot I sent previously which contained the ParentKey information on the server at BatchUpdate time?
As for the GetChanges question, I'll start another thread as it seems to confuse the parentkey issue.
Ok. I understand the situation. I need a little time to discuss with our developer regarding this issue. Currently, the collection of pending changes, doesn't have the information of ParentKey. Maybe I can talk to them for enhancement or something. I will let you know asap.
Is there an enhancement going in for this issue? This is a very important issue for us. Please let me know.
I haven't recieved any news from them. I emailed them today to remind about this issue. I will let you know after I got the news. 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