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
We are using WebGrid 7.0 in SharePoint web part and rendering the grid programatically.
We have one hidden column having some text value which we have associated with some visible column by specifying HiddenDataMember field.
in client side i am modifying the hidden data member value as mentined below.
var NormalField = cells.GetNamedItem("NormalField");
var HiddenField = NormalField.GetElement().attributes["MyHiddentDataMemberFieldName"].value;
//Now i am setting its value.
NormalField .GetElement().attributes["AssignmentComments"].value = "some sample text which should be accesseibel at server side also"
But, when i try to access the hidden field value on server side the way mentinoed below i still get the old value instead of the modified value. Any idea why is it so ?
//Following line gives me old value and not the client side modified new value.
webGridRow.Cells.GetNamedItem( "MyHiddentDataMemberFieldName" ).Value
Any idea ?
Thanks.
Hi Gaurav,
Thank you for your detail information about your scenario. There is a workaround for this scenario. First of all, in order to get this scenario, update the hidden data member, we will need to update them directly to its database.
So, there are two scenario can be done in here. One is, by closing the popup window, we will perform an update and refresh the grid so that, it will show us the updated value when we try to re-open the popup window. The other scenario is, by having a "Submit" button on outside the grid. However, after we update a value in the popup window and then close the popup window, the next time we open the popup window, it will still show us an old value. That is happened because we have not perform a refresh for WebGrid to retrieve a new value.
In my sample, it will show that every time we close a popup window, it will perform a refresh. So when we try to re-open the popup window, it will show us an updated value. If we want to use a "Submit" button, we can simply remove the Refresh action on InitializePostBack in server side and perform a WebGrid.Refresh() when the button is clicked.
I hope it helps. Thank you and have a nice day.
Best Regards,
Andi Santoso
Hi Gaurav Desai,
Unfortunately, our hidden data member is not meant to be two ways work. It cannot be updated from client side, it is actually for read only purpose. If you wanted to pass a value from client to server side, we do have a method for that.
However, I will need more detail information about your scenario. The hidden data member that has been send to server side must be related to database, for example, it will be used for a validation when we try to update a row. If we want to pass the value from client to server, we do have a method to do so, you can read our docs at "ms-help://ISNet.WebUI.WebGrid.V7/ISNet.WebUI.WebGrid/Advanced Client-Server Interaction Sample.html".
Basically, let say that we want to send the value from client to server on UpdateRow. We will need to use the OnBeforeUpdate Client side and catch the new value on UpdateRow server side event. Here is the snippet to do so:
function WebGrid1_OnBeforeUpdate(controlId, tblName, rowObject) { var WebGrid1 = ISGetObject(controlId); WebGrid1.AddInput("Value", "New Value"); return true; }
On the server side:
protected void WebGrid1_UpdateRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e) { string inputVal = Request["Value"].ToString(); }
So, in here, I pass the string "Value" which contains "NewValue" to server. And catch them in string "inputVal". I hope it helps. Thank you and have a nice day.
Hi,
I would describe the exact scenario here.. please suggest acordingly.
- We have a column coming from the data soruce lets say by name 'notes' which contains some text data entered previously by user so that field may or may not contain text data.
We are displaying a small icon inside the grid column on click of which a div pop up is displayed where the text of the 'notes' columns should be displayed if there was any previous note added by user. User should be able to add/edit this note and on click of 'save' button on the div , the div should be closed and modified/added notes should be kept somewhere in memory. [ This is where i was trying to set the modified/added text back to hidden field, which you now say is not possible ].
On click of 'Submit' button placed out side the grid all the modified rows having newlly added or modified notes should be saved to data base.
Hope above scenario will help you suggest a work around.
Looking forward..
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