Difference between revisions of "Help talk:Contents"

From Catglobe Wiki
Jump to: navigation, search
(New page: <source lang="csharp" line="1"><br>private DataTable GetPageData(int pageSize, int pageIndex)<br>{<br>DataTable source = this.SourceTable;<br>int startIndex = (pageIndex - 1) * pageS...)
 
(Removing all content from page)
Line 1: Line 1:
&lt;source lang="csharp" line="1"&gt;<br>private DataTable GetPageData(int pageSize, int pageIndex)<br>{<br>DataTable source = this.SourceTable;<br>int startIndex = (pageIndex - 1) * pageSize;<br>int endIndex;<br>if (startIndex + pageSize &gt; source.Rows.Count)<br>endIndex = source.Rows.Count;<br>else<br>endIndex = startIndex + pageSize;<br><br>DataTable pageData = new DataTable();<br><br>for (int i = 0; i &lt; source.Columns.Count; i++)<br>{<br>pageData.Columns.Add(source.Columns[i].ColumnName, source.Columns[i].DataType);<br>}<br>for (int i = startIndex; i &lt; endIndex; i++)<br>{<br>object[] newrow = new object[source.Columns.Count];<br>pageData.Rows.Add(source.Rows[i].ItemArray);<br>}
 
  
return pageData;<br>}
 
 
&lt;/source&gt;<br>
 

Revision as of 09:54, 22 December 2008