﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - How to set HiddenDataMember value from client side and later access modified value at server side ?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-hidden-field-value-from-client-side-and-later-access-modified-value-at-server-side-/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>How to set HiddenDataMember value from client side and later access modified value at server side ?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-hidden-field-value-from-client-side-and-later-access-modified-value-at-server-side-/</link><pubDate>Tue, 13 Apr 2010 03:07:04 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p /&gt;&lt;p style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Hi Gaurav,&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;     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.&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;     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.&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;     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.&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;     I hope it helps. Thank you and have a nice
day.&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>How to set HiddenDataMember value from client side and later access modified value at server side ?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-hidden-field-value-from-client-side-and-later-access-modified-value-at-server-side-/</link><pubDate>Mon, 12 Apr 2010 00:54:50 GMT</pubDate><dc:creator>desaigs81</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I would describe the exact scenario here.. please suggest acordingly.&lt;/p&gt;
&lt;p&gt;- 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.&lt;/p&gt;
&lt;p&gt;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 ]. &lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Hope above scenario will help you suggest a work around.&lt;/p&gt;
&lt;p&gt;Looking forward..&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>How to set HiddenDataMember value from client side and later access modified value at server side ?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-hidden-field-value-from-client-side-and-later-access-modified-value-at-server-side-/</link><pubDate>Thu, 08 Apr 2010 03:57:01 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p /&gt;&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Hi Gaurav Desai,&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;    
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.&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;    
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".&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;    
 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:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif; color: black; " /&gt;&lt;/p&gt;&lt;pre&gt;function WebGrid1_OnBeforeUpdate(controlId, tblName, rowObject)
{
	var WebGrid1 = ISGetObject(controlId);
	WebGrid1.AddInput("Value", "New Value");
			
	return true;
}&lt;/pre&gt;
&lt;p /&gt;
&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif; color: black; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;
&amp;nbsp; On the server side:&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif; color: black; " /&gt;&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_UpdateRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{
        string inputVal = Request["Value"].ToString();
              
}&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;
&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif; color: black; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;
&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt; 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.&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>How to set HiddenDataMember value from client side and later access modified value at server side ?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-hidden-field-value-from-client-side-and-later-access-modified-value-at-server-side-/</link><pubDate>Wed, 07 Apr 2010 12:32:07 GMT</pubDate><dc:creator>desaigs81</dc:creator><description>&lt;p&gt;We are using WebGrid 7.0 in SharePoint web part and rendering the grid programatically.&lt;/p&gt;
&lt;p&gt;We have one hidden column having some text value which we have associated with some visible column by specifying HiddenDataMember field.&lt;/p&gt;
&lt;p&gt;in client side i am modifying the hidden data member value as mentined below.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;var NormalField = cells.GetNamedItem("NormalField");   &lt;/p&gt;
&lt;p&gt;var HiddenField = NormalField.GetElement().attributes["MyHiddentDataMemberFieldName"].value;  &lt;/p&gt;
&lt;p&gt;//Now i am setting its value.&lt;/p&gt;
&lt;p&gt;NormalField .GetElement().attributes["AssignmentComments"].value = "some sample text which should be accesseibel at server side also"&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;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 ? &lt;/p&gt;
&lt;p&gt;//Following line gives me old value and not the client side modified new value.&lt;/p&gt;
&lt;p&gt;webGridRow.Cells.GetNamedItem( "MyHiddentDataMemberFieldName" ).Value&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Any idea ?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>