Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Help talk:Contents: Difference between revisions

Discussion page of Help:Contents
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 07:54, 22 December 2008