LoadItemsEventArgs Class

Provides data for ASP.NET mobile controls that support custom pagination.

public class System.Web.UI.MobileControls.LoadItemsEventArgs : 
   System.EventArgs

Remarks

The class object provides an event handler with information about how many items to load into the control on demand.

Example

This example demonstrates how the OnLoadItem event calls the function LoadNow. One of the arguments is LoadItemsEventArgs. The ItemIndex property of this argument determines the number of items to be added to an array that gets bound to a list.

<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" 
   Language="c#" debug=true%>

<script language="c#" runat="server">

void LoadNow(object sender, LoadItemsEventArgs e)
{
   int j=0;
   ((System.Web.UI.MobileControls.Label)Form1.Header.FindControl("label1")).Text =
      "Maximum Item Allowed In page is "+Convert.ToString(e.ItemCount);
   List1.Items.Clear();
   ArrayList arr= new ArrayList();

   for(int i=0; i<=e.ItemCount;i++)
   {
      j=e.ItemIndex;
      j = j + i;      
      arr.Add (j);
   }
   List1.DataSource=arr;
   List1.DataBind();
}
</script>

<Mobile:Form runat="server" id=Form1 Paginate=true>
   <DeviceSpecific>
      <Choice>
         <HeaderTemplate>
            <Mobile:Label runat="server" id=label1  StyleReference="title" />
         </HeaderTemplate>
      </Choice>
   </DeviceSpecific>
   <Mobile:List id="List1" runat="server" ItemCount=20000 
      onLoadItems = "LoadNow" />
</Mobile:Form>

Requirements

Namespace: System.Mobile.Web.UI.MobileControls

Assembly: System.Web.Mobile

See Also

Pagination Support | Pagination