Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MmGridView support paging ?
Message
 
To
28/11/2006 11:05:22
Bill Oeftering
Mainstreet Computers, Inc.
Belleville, Michigan, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01172961
Message ID:
01173494
Views:
9
>Using the jump start example customerorders.aspx form I set AllowPaging=true, PageSize=3. I have no code in PageIndexChanging and PageIndexChanged events. The page links appear but it never pages - no errors. Does this need some addition code ?

For paging, you can create a method which handles the PageIndexChanging() event of the GridView. Inside of this method, write code that does something like:
// Replace with method(s) that retrieve your data.
this.m_businessObject.GetAllData();
this.grdGridView.PageIndex = e.NewPageIndex;
this.DataBind();
For sorting, you can set the BindingSource to your business object name, the BindingSourceMember to something like TableName.DefaultView (replace TableName with the real table name).

Then create a method which handles the Sorting() event:
string sort = "ASC";

if (e.SortDirection == SortDirection.Descending)
{
   sort = "DESC";
}

this.m_businessObject.GetAllData();
this.m_businessObject.DataSet.Tables[0].DefaultView.Sort = e.SortExpression + " " + sort;
this.DataBind();
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform