<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: jqGrid and wcf issue</title>
	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-wcf-issue</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-wcf-issue/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on jqGrid and wcf issue</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-wcf-issue#p16995</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-wcf-issue#p16995</guid>
        	        	<description><![CDATA[<p>No problem!</p>
</p>
<p>Let us you have a WFC with a function like</p>
<p>&#160;&#160;&#160; List&#60;MyInfo&#62; GetMyInfo (bool myBoolParam, string myStrParam, int myIntParam);</p>
<p>in the interface and in general your data model and you business logic can be implemented with paging of data and with a data filtering (like WHERE in the corresponding SELECT statments). You can expand you WFC interface with a function like</p>
<p>[WebGet (UriTemplate = "jqGridGetMyInfo?boolParam={myBoolParam}&#38;strParam={myStrParam}&#38;intParam={myIntParam}&#38;_search={_search}&#38;page={page}&#38;rows={rows}&#38;sidx={sortIndex}&#38;sord={sortDirection}&#38;searchField={searchField}&#38;searchString={searchString}&#38;searchOper={searchOper}&#38;filters={filters}",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ResponseFormat = WebMessageFormat.Json)]<br />[OperationContract]<br />CompactJqGridTable GetMyInfo (bool myBoolParam, string myStrParam, int myIntParam,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; int page, int rows, string sortIndex, string sortDirection,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; string _search, string searchField, string searchString, string searchOper, string filters);</p>
<p>In this example I use JSON data in the output in so named "optimized" form. See jqGrid Demo <a href="http://trirand.com/blog/jqgrid/jqgrid.html" rel="nofollow" target="_blank">http://trirand.com/blog/jqgrid/jqgrid.html</a>, choose on the left tree part the branch "Data Mapping" and then "Data Optimization". In this way you transfer the data from server to client with the minimal overhead. Class CompactJqGridTable I define like following</p>
<p>// next class will be used together with<br />// jsonReader: { repeatitems : true, cell:"", id: "0" }<br />public class CompactTable {<br />&#160;&#160;&#160; public int total { get; set; }&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // total number of pages<br />&#160;&#160;&#160; public int page { get; set; }&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // current zero based page number<br />&#160;&#160;&#160; public int records { get; set; }&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // total number of records<br />&#160;&#160;&#160; public List&#60;List&#60;string&#62;&#62; rows { get; set; } // first element in every row must be id of row.<br />}</p>
<p>Now the implementation of CompactJqGridTable GetMyInfo () looks like following:</p>
<p>public CompactJqGridTable GetMyInfo (...) {<br />&#160;&#160;&#160; // GetMyInfoAdvanced supports paging searching etc. which the original GetMyInfo not soports<br />&#160;&#160;&#160; // and has an additional output parameter which gives the total number of data records<br />&#160;&#160;&#160; int totalRecords;<br />&#160;&#160;&#160; List&#60;MyInfo&#62; myInfos = GetMyInfoAdvanced&#160; (myBoolParam, myStrParam, myIntParam,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; page, rows, sortIndex, sortDirection, ..., out totalRecords);<br />&#160;&#160;&#160; List&#60;List&#60;string&#62;&#62; jqGridRows = new  List&#60;List&#60;string&#62;&#62; (myInfos.Count);</p>
<p>&#160;&#160;&#160; foreach (MyInfo item in myInfos) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; jqGridRows.Add (new List&#60;string&#62; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; item.TextProperty1,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; item.TextProperty2,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; item.IntProperty1.ToString(),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; item.BoolProperty1? "1": "0",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ...<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; });<br />&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160; return new CompactTable() {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; total=(totalRecords + rows - 1) / rows,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; page = page,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; records = totalRecords,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; rows = resRows<br />&#160;&#160;&#160; };<br />}</p>
<p>Take in consideration, that a boolean you can send as "True"/"False" text if you use item.BoolProperty1.ToString(), but serializing it as "1" or "0" reduce the saze of data send from server to client.</p>
<p>In Javascript part I change default some settings, bacause I use only JSON in all jqGrids:</p>
<p>jQuery.extend(jQuery.jgrid.defaults, {<br />&#160;&#160;&#160; datatype: &#39;json&#39;,<br />&#160;&#160;&#160; ajaxGridOptions: { contentType: "application/json" },<br />&#160;&#160;&#160; gridview: true,<br />&#160;&#160;&#160; rownumbers: true,<br />&#160;&#160;&#160; sortable: true,<br />&#160;&#160;&#160; headertitles: true,<br />&#160;&#160;&#160; loadui: &#39;block&#39;,<br />&#160;&#160;&#160; ....<br />};</p>
<p>Only first two settings are important for communication in JSON. Setting "gridview: true" speed up jqGrid and should be used allways if you don&#39;t use afterInsertRow function subGrids or treeGrids. Other settings are just some settings which I personally like and use everywere.</p>
<p>A typical jqGrid call looks like</p>
<p>var grid = jQuery(&#39;#list&#39;).jqGrid({<br />&#160;&#160;&#160; url: urlBase + &#39;/jqGridGetMyInfo&#39;,<br />&#160;&#160;&#160; jsonReader: { repeatitems: true, cell: "", id: "0" },<br />&#160;&#160;&#160; ...<br />});</p>
<p>If you use everyware in your jqGrids the same "optimized" form of data transfere you can move jsonReader parameter to above settings of jQuery.jgrid.defaults.</p>
<p>If you prefer use another (not "optimized") data transfer it can be  interesting for you to read my post in stackoverflow:  <a href="http://stackoverflow.com/questions/2690657/mapping-json-data-in-jqgrid/2706620#2706620" rel="nofollow" target="_blank">http://stackoverflow.com/questions/2690657/mapping-json-data-in-jqgrid/2706620#2706620</a>.</p>
<p>In our example we have additional parameters bool myBoolParam, string myStrParam, int myIntParam which should be send to jqGrid. If such more complex examples I have on the web page together with jqGrid control some additional controls like select boxes and checkboxes. The values of myBoolParam, myStrParam and myIntParam will derived from the values of this controls. One can append jqGrid url with this parameters or better use postData paraleter of jqGrid in a form</p>
<p>postData: {boolParam: myBoolParam, strParam: myStrParam, intParam: myIntParam}</p>
<p>or in the form</p>
<p>postData: {boolParam: function() { return jQuery("#checkBoxWithBoolParam").is(&#39;:checked&#39;); },<br />&#160;&#160;&#160; strParam: function() { return jQuery("#selectBoxWithStrParam option:selected").val(); },<br />&#160;&#160;&#160; intParam:  function() { return jQuery("#selectBoxWithIntParam option:selected").val(); }<br />}</p>
<p>In both cases the url used to get data from the server will be appended by jQuery.ajax (used by jqGrid) with the parameters exactly how it should be (&#39;?&#39; and &#39;&#38;&#39; will be inserted).</p>
<p>At the end I call trigger(&#39;reloadGrid&#39;) to load data corresponds to the new url.</p>
<p>Using of <em>trigger(&#39;reloadGrid&#39;) </em>in jqGrid I discuss in <a href="http://stackoverflow.com/questions/2660226/should-one-replace-the-usage-addjsondata-of-jqgrid-to-the-usage-of-setgridparam" rel="nofollow" target="_blank">http://stackoverflow.com/questions/2660226/should-one-replace-the-usage-addjsondata-of-jqgrid-to-the-usage-of-setgridparam</a>.</p>
<p>Some additional information about ajaxGridOptions and other ajax options of jqGrid you can read in one more my post on stackoverflow: <a href="http://stackoverflow.com/questions/2675625/setting-the-content-type-of-requests-performed-by-jquery-jqgrid/2678731#2678731" rel="nofollow" target="_blank">http://stackoverflow.com/questions/2675625/setting-the-content-type-of-requests-performed-by-jquery-jqgrid/2678731#2678731</a>.</p>
<p>Probably my answer has become somewhat  overloaded, but I hope you will get an impression, that one <strong>can</strong> very good use jqGrid together with WFC service on the server side.</p></p>
]]></description>
        	        	<pubDate>Fri, 07 May 2010 02:55:16 +0300</pubDate>
        </item>
        <item>
        	<title>nickka on jqGrid and wcf issue</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-wcf-issue#p16991</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-wcf-issue#p16991</guid>
        	        	<description><![CDATA[<p>I have jqGrid working with a WCF service but have been unable to get the rows, page, total parameters passed to the WCF service. In doing searches, this article is the closest that I have found to addressing this however it leaves a lot of unanswered questions.</p>
<p>I&#39;m using Visual Studio.Net 2008 and it does not recognize this as a parameter in the service:</p>
<p>PagedData&#60;Data.Area&#62; GetAreaData(PagingControl paging). PagedData and PagingControl are the two classes that I created per the article, but what is Data.Area and GetAreaData?</p>
<p>Can anyone answer this or refer me to an example that tells how to work with the open source version of jqGrid (not the premium ASP.Net Version and not MVC) to call a WCF servce and get the rows, page, total parameters passed to the service?</p>
]]></description>
        	        	<pubDate>Thu, 06 May 2010 22:49:24 +0300</pubDate>
        </item>
        <item>
        	<title>SteveT on jqGrid and wcf issue</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-wcf-issue#p12801</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-wcf-issue#p12801</guid>
        	        	<description><![CDATA[<p>I&#39;ll share what we have done with WCF.&#160; First we created a common parameters class.&#160; These should be most of all the parameter&#39;s that jqGrid will send.&#160;<span style="font-size: x-small;"></span></p>
<blockquote>
<p>[DataContract]</p>
</blockquote>
<blockquote>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;"></span></span></p>
<p>public</p>
</p>
<p><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">class</span></span><span style="font-size: x-small;"> </span><span style="color: #2b91af; font-size: x-small;"><span style="color: #2b91af; font-size: x-small;">PagingControl</span></span></p>
<p><span style="font-size: x-small;"></span></p>
<p>{</p>
<p>[DataMember]</p>
</p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">public</span></span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">string</span></span><span style="font-size: x-small;"> q { </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">get</span></span><span style="font-size: x-small;">; </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">set</span></span><span style="font-size: x-small;">; }</span></p>
<p>[DataMember]</p>
</p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">public</span></span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">int</span></span><span style="font-size: x-small;">? limit { </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">get</span></span><span style="font-size: x-small;">; </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">set</span></span><span style="font-size: x-small;">; }</span></p>
<p>[DataMember]</p>
</p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">public</span></span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">string</span></span><span style="font-size: x-small;"> o { </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">get</span></span><span style="font-size: x-small;">; </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">set</span></span><span style="font-size: x-small;">; }</span></p>
<p>[DataMember]</p>
</p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">public</span></span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">int</span></span><span style="font-size: x-small;">? rows { </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">get</span></span><span style="font-size: x-small;">; </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">set</span></span><span style="font-size: x-small;">; }</span></p>
<p>[DataMember]</p>
</p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">public</span></span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">int</span></span><span style="font-size: x-small;">? page { </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">get</span></span><span style="font-size: x-small;">; </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">set</span></span><span style="font-size: x-small;">; }</span></p>
<p>[DataMember]</p>
</p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">public</span></span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">string</span></span><span style="font-size: x-small;"> searchString { </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">get</span></span><span style="font-size: x-small;">; </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">set</span></span><span style="font-size: x-small;">; }</span></p>
<p>[DataMember]</p>
</p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">public</span></span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">string</span></span><span style="font-size: x-small;"> sidx { </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">get</span></span><span style="font-size: x-small;">; </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">set</span></span><span style="font-size: x-small;">; }</span></p>
<p>[DataMember]</p>
</p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">public</span></span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">string</span></span><span style="font-size: x-small;"> sord { </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">get</span></span><span style="font-size: x-small;">; </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">set</span></span><span style="font-size: x-small;">; }</span></p>
<p>}</p>
</p>
</blockquote>
<p>&#160;This class is used as a paramater for the WCF method:&#160;<span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;"></span></span></p>
<blockquote>
<p>public</p>
</blockquote>
<blockquote>
</blockquote>
<blockquote>
<p><span style="font-size: x-small;"> </span><span style="color: #2b91af; font-size: x-small;"><span style="color: #2b91af; font-size: x-small;">PagedData</span></span><span style="font-size: x-small;">&#60;Data.</span><span style="color: #2b91af; font-size: x-small;"><span style="color: #2b91af; font-size: x-small;">Area</span></span><span style="font-size: x-small;">&#62; GetAreaData(</span><span style="color: #2b91af; font-size: x-small;"><span style="color: #2b91af; font-size: x-small;">PagingControl</span></span><span style="font-size: x-small;"> paging)</span></p>
</blockquote>
<p>The PagedData is also a common class we use for returning jqGrid data:&#160;<span style="font-size: x-small;"></span></p>
<blockquote>
<p>[</p>
</blockquote>
<blockquote>
<p><span style="color: #2b91af; font-size: x-small;"><span style="color: #2b91af; font-size: x-small;">DataContract</span></span><span style="font-size: x-small;">]</p>
<p></span></p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">public</span></span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">class</span></span><span style="font-size: x-small;"> </span><span style="color: #2b91af; font-size: x-small;"><span style="color: #2b91af; font-size: x-small;">PagedData</span></span><span style="font-size: x-small;">&#60;T&#62;</span></p>
<p>{</p>
<p>[</p>
</p>
<p><span style="color: #2b91af; font-size: x-small;"><span style="color: #2b91af; font-size: x-small;">DataMember</span></span><span style="font-size: x-small;">(Name = </span><span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">"total"</span></span><span style="font-size: x-small;">)]</p>
<p></span></p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">public</span></span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">int</span></span><span style="font-size: x-small;"> Total { </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">get</span></span><span style="font-size: x-small;">; </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">set</span></span><span style="font-size: x-small;">; }</span></p>
<p>[</p>
</p>
<p><span style="color: #2b91af; font-size: x-small;"><span style="color: #2b91af; font-size: x-small;">DataMember</span></span><span style="font-size: x-small;">(Name = </span><span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">"page"</span></span><span style="font-size: x-small;">)]</p>
<p></span></p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">public</span></span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">int</span></span><span style="font-size: x-small;"> Page { </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">get</span></span><span style="font-size: x-small;">; </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">set</span></span><span style="font-size: x-small;">; }</span></p>
<p>[</p>
</p>
<p><span style="color: #2b91af; font-size: x-small;"><span style="color: #2b91af; font-size: x-small;">DataMember</span></span><span style="font-size: x-small;">(Name = </span><span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">"records"</span></span><span style="font-size: x-small;">)]</p>
<p></span></p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">public</span></span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">int</span></span><span style="font-size: x-small;"> Records { </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">get</span></span><span style="font-size: x-small;">; </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">set</span></span><span style="font-size: x-small;">; }</span></p>
<p>[</p>
</p>
<p><span style="color: #2b91af; font-size: x-small;"><span style="color: #2b91af; font-size: x-small;">DataMember</span></span><span style="font-size: x-small;">(Name = </span><span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">"rows"</span></span><span style="font-size: x-small;">)]</p>
<p></span></p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">public</span></span><span style="font-size: x-small;"> </span><span style="color: #2b91af; font-size: x-small;"><span style="color: #2b91af; font-size: x-small;">IEnumerable</span></span><span style="font-size: x-small;">&#60;T&#62; Rows { </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">get</span></span><span style="font-size: x-small;">; </span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">set</span></span><span style="font-size: x-small;">; }</span></p>
<p>}</p>
</p>
</blockquote>
<p>&#160;So in the WCF method all we do is create PagedData and set the properties.&#160;</p>
<p>&#160;Also, the client side jqGrid options that we set are:</p>
</p>
<blockquote>
<p><span style="font-size: x-small;"></span></p>
<p>jsonReader: {</p>
<p>repeatitems:</p>
</p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">false</span></span><span style="font-size: x-small;">,</span></p>
<p>id:</p>
</p>
<p><span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">"0"</span></span></p>
<p><span style="font-size: x-small;"></span></p>
<p>},</p>
<p>ajaxGridOptions: {</p>
<p>type:</p>
</p>
<p><span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">"POST"</span></span><span style="font-size: x-small;">,</span></p>
<p>contentType:</p>
</p>
<p><span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">"application/json; charset=utf-8"</span></span></p>
<p><span style="font-size: x-small;"></span></p>
<p>},</p>
<p>datatype:</p>
</p>
<p><span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">"json"</span></span><span style="font-size: x-small;">,</span></p>
<p>serializeGridData:</p>
</p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">function</span></span><span style="font-size: x-small;">(postdata) {</span></p>
<p><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">return</span></span><span style="font-size: x-small;"> <span style="font-size: x-small;">JSON.stringify</span>(paging: postdata);</span></p>
<p><span style="font-size: x-small;">},</span></p>
</blockquote>
<p>&#160;Maybe when I get a chance I can create a sample application using &#160;WCF.</p>
]]></description>
        	        	<pubDate>Mon, 07 Dec 2009 19:35:53 +0200</pubDate>
        </item>
        <item>
        	<title>tony on jqGrid and wcf issue</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-wcf-issue#p12010</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-wcf-issue#p12010</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Sorry I do not understand WCF, but if you maybe look here</p>
<p><a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data" rel="nofollow" target="_blank"><a href="http://www.trirand.com/jqgridw" rel="nofollow">http://www.trirand.com/jqgridw</a>.....eving_data</a></p>
<p>you will have idea what to do</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 16 Nov 2009 23:26:35 +0200</pubDate>
        </item>
        <item>
        	<title>Miaobing on jqGrid and wcf issue</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-wcf-issue#p11882</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-wcf-issue#p11882</guid>
        	        	<description><![CDATA[<p>Could some one tell me how to use the jqgrid by calling the wcf service to retrieve the data? And in order to &#160;retrieve the data , how to post the parameters(sortname,sortorder,page, and so on) to the server?</p>
<p>Any suggestions or &#160;helps will be appreciated.</p>
<p><img class="spSmiley" style="margin:0" title="Smile" src="/blog/wp-content/forum-smileys/sf-smile.gif" alt="Smile" /></p>
]]></description>
        	        	<pubDate>Thu, 12 Nov 2009 21:57:44 +0200</pubDate>
        </item>
</channel>
</rss>