RE: ObjectList Data-Binding to a List<MyClass>
- From: stcheng@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
- Date: Wed, 05 Sep 2007 03:12:29 GMT
Thanks for your followup Alex,
Yes, <ItemTemplate> will be displayed first, while <ItemDetailsTemplate> is
to displayed when a certain record is further choosen by the user. Anyway,
I'm glad that you've got the one you want.
For the document issue, I agree that the current samples and tutorials for
ASP.NET Mobile application are so limited. I think it is also probably due
to more users are focus on the standard web application developing. Anyway,
your comments and feedback is really appreicated and I suggest you submit
them to our feedback center:
https://connect.microsoft.com/feedback/default.aspx?SiteID=210&wa=wsignin1.0
You can also directly submit feedback through the web document page's
feedback button (on msdn2.microsoft.com....).
Thanks again for your posting and support to us!
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Thread-Topic: ObjectList Data-Binding to a List<MyClass>
From: =?Utf-8?B?QWxleCBNYWdoZW4=?= <AlexMaghen@xxxxxxxxxxxxxxxx>
documentation
Actually, the problem, it turns out, was that I was using
<ItemDetailsTemplate> when I should have been using <ItemTemplate>. When I
use that instead, the thing does what I need. I really appreciate all your
help. One suggestion: The whole ObjectList, DeviceSpecific, etc., etc.
business is, in my opinion, VERY poorly documented. Usually, you guys do a
really good job of definition, how-to, etc. In this area, the
is really very poor.still
In any case, I'm okay now. I really appreciate all your help.
Thanks.
Alex
"Steven Cheng[MSFT]" wrote:
Thanks for your followup Alex,
For the "ItemDetailsTemplate" template issue you mentioned, it maybe
otherdue to the control use the default template since there may have any
issetting and prevent your custom one from display. Yes, mobile control
feelnot natually targeting html from its designate, so that does make us
rights.abit inconvenient when we want to author standard html/xhtml content for
mobile page.
BTW, as most smart devices not support html and asp.net standard
application control also have adaptable rendering model, maybe you can
consider use a standard aspx page here as you will mostly use html based
content. Is this possible in your application?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
<ItemDetailsTemplate>.
--------------------
Thread-Topic: ObjectList Data-Binding to a List<MyClass>
Date: Fri, 31 Aug 2007 07:52:01 -0700
adding
Steven -
One more note: I have successfully gotton it to show both columns by
TableFields="ID;UserTitle"
to the <mobile:ObjectList...> tag. But I still can't get it to display
standard text of mark-up that I have placed in the
IIt
just ignores that and only displays the <mobile: Label...> objects that
sohave bound to my data fields. What is *with* this control?! Why is it
HTMLconstrained? All I want is a control that allows me to manually build
memarkup for each object in a list (whether a database DataTable or someother
kind of list). I have that *so* easily with the Repeater control instandard
ASPX which allows me to repeat *anyuthing* over and over again based onrows
from a List. What that markup is that is sent to the browser is up to
Whyand
if I include items that the browser can't handle, that's *my* problem.
forcan't I do that in mobile. Sorry, but this is incredibly frustrating
listingsomething so simple.and am
As always, thanks!
Alex
"Alex Maghen" wrote:
Steven -
Thanks for getting back to me about all these posts. I have been away
just getting back to it now. I must say, I find this entire approach
*incredibly* complicated for something as simple as providing a
canof
objects/assets from a List or Database table. But there's nothing I
gettingdo
understand.about it, I guess so I have to keep bothering you until I really
I implemented exactly what you defined below and I'm no longer
Eval("ID")the
error I was getting before, but I *am* still having a problem:
In the <ItemDetailsTemplate> section (below), I've presented two
<mobile:Label ...> objects, one whose content is set to: <%#
single%>
alsoand another whose content is set to <%# Eval("UserTitle") %>. I then
added the two <Field...> tags for ID and UserTitle below (just as you
defined). When I run this, though, all I see is a "table" with a
labelcolumn showing the "ID" header and "ID" entries only. The second
Thisfor
thethe "UserTitle" is simply not shown. Also, in your sample, you placed
text "detail template:" just inside the <ItemDetailsTemplate> tag.
datais
everyliteral text and I would have assumed that it would just show up in
"Mobilerow. Instead, it doesn't show up at all.
Can you please help? This is an incredibly complicated way of doing
something really simple - or so it seems.
Thanks as always.
Alex
"Steven Cheng[MSFT]" wrote:
Hi Alex,
Seems this is a continual post from a former thread discussing on
error youRepeater", correct?
I've performed test through the code you provided and did met the
said. After some research, I found that the error is caused by no
youofffields are defined in the ObjectList control. Actually, if you turn
"AutoGenerateFields" in ObjectList, you need to supply the fields
addwant
to use in your ObjectList. You should use the <Field > element to
advancedAutoGenerateFields="False"fields definition into the ObjectList.
For your "TestClass" scenario, here is the expected ObjectList aspx
template:
================
<mobile:ObjectList ID="ObjectList1" Runat="server"
CommandStyle-StyleReference="subcommand"
LabelStyle-StyleReference="title"
Eval("UserTitle")LabelField="UserTitle" >
<DeviceSpecific ID="ds_ol1" Runat="server">
<Choice >
<ItemDetailsTemplate>
detail template:
<mobile:Label ID="Label1" Runat="server"><%# Eval("ID")
%></mobile:Label>
<mobile:Label ID="Label2" Runat="server"><%#
%></mobile:Label>
</ItemDetailsTemplate>
</Choice>
</DeviceSpecific>
<Field Title="ID" DataField="ID" />
<Field Title="UserTitle" DataField="UserTitle" />
</mobile:ObjectList>
========================
Also, I found a good web forum thread which has included some
looksetting and usage upon ObjectList control, you can also have a
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notifif you
need some further customzation or event handling:
http://forums.asp.net/p/1146753/1862202.aspx
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
reachissuesications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent
followwhere an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
up response may take approximately 2 business days as the support
professional working with you may need further investigation to
complexthe
situationsmost efficient resolution. The offering is not appropriate for
that require urgent, real-time or phone-based interactions or
areproject analysis and dump analysis issues. Issues of this nature
best
contactinghandled working with a dedicated Microsoft Support Engineer by
rights.Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
.
- References:
- RE: ObjectList Data-Binding to a List<MyClass>
- From: Steven Cheng[MSFT]
- RE: ObjectList Data-Binding to a List<MyClass>
- From: Alex Maghen
- RE: ObjectList Data-Binding to a List<MyClass>
- Prev by Date: Re: Controls.Count, Controls.IsSynchronized, and Controls.SyncRoot
- Next by Date: Re: Controls.Count, Controls.IsSynchronized, and Controls.SyncRoot
- Previous by thread: RE: ObjectList Data-Binding to a List<MyClass>
- Next by thread: Curious problems
- Index(es):