Hi Alex,
Thanks for your followup.
Regarding on the further questions you mentioned, I think you can do it as
below:
** To bind to your custom class's collection, you can simply use the
ObjectList's DataSource property and DataBind method e.g.
===================
public partial class _Default : System.Web.UI.MobileControls.MobilePage
{
protected void Page_Load(object sender, EventArgs e)
{
BindList1();
}
protected void BindList1()
{
ItemClass[] items = new ItemClass[3];
for (int i = 1; i <= 3; i++)
{
ItemClass item = new ItemClass(i, "item" + i,
"
http://www.asp.net/App_Themes/Standard/i/logo.png");
items[i - 1] = item;
}
ObjectList1.DataSource = items;
ObjectList1.DataBind();
}
..........
=============================
For the define customizing template, you need to use <DeviceSpecific>
setting and you can supply mutiple <choice> segment for different device
setting e.g.
==================
<mobile:ObjectList ID="ObjectList1" Runat="server"
CommandStyle-StyleReference="subcommand" AutoGenerateFields="False"
LabelStyle-StyleReference="title"
<DeviceSpecific >
<Choice Filter="IsIE">
<ItemDetailsTemplate>
<br /><asp:Label ID="Label1" runat="server" Text='<%#
Eval("ID") %>'></asp:Label>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Name")
%>'></asp:Label>
<asp:Image ID="Image1" runat="server" ImageUrl='<%#
Eval("Logo") %>' />
<asp:Button ID="Button1" runat="server" Text="Choose" />
</ItemDetailsTemplate>
</Choice>
<Choice Filter="IsNotIE">
<ItemDetailsTemplate>
<mobile:Label ID="Label4" Runat="server"><%# Eval("ID")
%></mobile:Label>
<mobile:Label ID="Label2" Runat="server"><%# Eval("Name")
%></mobile:Label>
<mobile:Image ID="Image2" Runat="server"
ImageUrl="
http://www.asp.net/App_Themes/Standard/i/logo.png"></mobile:Image>
</ItemDetailsTemplate>
</Choice>
</DeviceSpecific>
</mobile:ObjectList>
===========================
In the above template, one template is using HTML (standard ASP.NET
controls) and another is using mobile controls.
For the configuration and usage of DeviceFilters, you can refer to the MSDN
document or some web articles:
#Using Device Filters
https://msdn2.microsoft.com/en-us/library/d7k7a6z2.aspx
#<deviceFilters>
http://msdn2.microsoft.com/en-us/library/k25f323z.aspx
#<Choice> Element (.NET Framework Developer's Guide )
http://msdn2.microsoft.com/en-us/library/3tfbhf6f.aspx
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.