Subscribe

RSS Feed (xml)

Displaying ObjectList Information in a Table

The ASPX page is as follows:


<mobile:Form id="Form1" runat="server">


<mobile:ObjectList id="ObjectList1" runat="server"


LabelStyle-StyleReference="title"


CommandStyle-StyleReference="subcommand" >


</mobile:ObjectList>


</mobile:Form>


In


<script runat="server" /> block or codebehind:


Sub Page_Load


' Code here to retrieve Book Listing


' Fields returned are


' - BookName


' - BookCategory


' - BookISBN


ObjectList1.DataSource = myBookList


ObjectList1.LabelField = "BookName"


ObjectList1.TableFields= "BookName;BookCategory;BookISBN"


ObjectList1.DataBind()


End Sub


Comments


The ObjectList control is the mobile control equivalent to the ASP.NET DataGrid.The


default display of the ObjectList in all devices is a single column listing of links.You designate


the field to be displayed as the link using the LabelField property. Clicking on


the link takes you to another screen that displays all fields for that item.


On mobile devices that have browsers that support HTML markup, it is possible to


display the initial listing in a tabular format by using the TableFields property. As


shown in this example, you need to separate each field that is to be displayed by a semicolon.


The first item in the TableField list is designated as the LabelField. Note that on


devices that do not support HTML markup, the ObjectList provides the default display.

No comments:

Archives

Variety in the Web World