[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

RE: ObjectList Control - Width and Font Properties

Mark Gialo

12/18/2006 2:14:00 AM

JJ...i am not sure why the mobile web form below does not render borders. My
ItemTemplate renders the columns properly, but the HeaderTemplate is not
allowing borders, and the columns are not lining up with the items being
rendered.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Table.aspx.cs"
Inherits="Table" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>

<html xmlns="http://www.w3.org/1999/x... >
<body>
<mobile:Form id="Form1" runat="server">
<mobile:ObjectList ID="ObjectList1" Runat="server"
CommandStyle-StyleReference="subcommand"
LabelStyle-Reference="title">
<DeviceSpecific>
<Choice>
<HeaderTemplate>
<table border="2">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:LinkButton id="LinkButton1" Width=100
Runat="server">
<%# ((ObjectListItem)Container)["dt_1"] %>
</asp:LinkButton></td>
<td><asp:LinkButton id="LinkButton2" Width=100
Runat="server">
<%# ((ObjectListItem)Container)["dt_2"] %>
</asp:LinkButton></td>
<td><asp:LinkButton id="LinkButton3"
Width=100Runat="server">
<%# ((ObjectListItem)Container)["dt_3"] %>
</asp:LinkButton></td>
<br></br>
</tr>
</table>
</ItemTemplate>
</Choice>
</DeviceSpecific>
</mobile:ObjectList>
</mobile:Form>
</body>
</html>

"Mark Gialo" wrote:

> My mobile application has three columns in an objectlist. When rendering this
> to a blackberry device, the text is wrapping signifying perhaps the font size
> or width of the control is too large.
>
> Is there any way to set a pixel size for the objeclist control? or perhaps
> another way to insure it renders properly.
2 Answers

JJ

12/22/2006 2:48:00 PM

0

Does it render borders if you open the page in IE?

Tables are somewhat flaky on the BB. If things don't align right, try
putting "width=X%" attributes in your <td> tags and try to use that to get
spacing right.

With the mobile forms, you are dealing with two forces - one is that the
asp.net mobile form rendering engine will strip out some HTML elements
(although it should not touch them in a DeviceSpecific section) and the
other is the BB rendering.

I see one problem in your code - you have the </table> within the
ItemTemplate, which will get rendered for every row, so if you display more
than one row, you will have too many </table> tags.

If you are going to start a <table> in the <HeaderTemplate>, then you need
to close the tag in the <FooterTemplate>, not in the <ItemTemplate>


"Mark Gialo" <MarkGialo@discussions.microsoft.com> wrote in message
news:9DD35E30-B4E7-49A9-8566-F0EDC3185865@microsoft.com...
> JJ...i am not sure why the mobile web form below does not render borders.
> My
> ItemTemplate renders the columns properly, but the HeaderTemplate is not
> allowing borders, and the columns are not lining up with the items being
> rendered.
>
> <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Table.aspx.cs"
> Inherits="Table" %>
> <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls"
> Assembly="System.Web.Mobile" %>
>
> <html xmlns="http://www.w3.org/1999/x... >
> <body>
> <mobile:Form id="Form1" runat="server">
> <mobile:ObjectList ID="ObjectList1" Runat="server"
> CommandStyle-StyleReference="subcommand"
> LabelStyle-Reference="title">
> <DeviceSpecific>
> <Choice>
> <HeaderTemplate>
> <table border="2">
> </HeaderTemplate>
> <ItemTemplate>
> <tr>
> <td><asp:LinkButton id="LinkButton1" Width=100
> Runat="server">
> <%# ((ObjectListItem)Container)["dt_1"] %>
> </asp:LinkButton></td>
> <td><asp:LinkButton id="LinkButton2" Width=100
> Runat="server">
> <%# ((ObjectListItem)Container)["dt_2"] %>
> </asp:LinkButton></td>
> <td><asp:LinkButton id="LinkButton3"
> Width=100Runat="server">
> <%# ((ObjectListItem)Container)["dt_3"] %>
> </asp:LinkButton></td>
> <br></br>
> </tr>
> </table>
> </ItemTemplate>
> </Choice>
> </DeviceSpecific>
> </mobile:ObjectList>
> </mobile:Form>
> </body>
> </html>
>
> "Mark Gialo" wrote:
>
>> My mobile application has three columns in an objectlist. When rendering
>> this
>> to a blackberry device, the text is wrapping signifying perhaps the font
>> size
>> or width of the control is too large.
>>
>> Is there any way to set a pixel size for the objeclist control? or
>> perhaps
>> another way to insure it renders properly.


Mark Gialo

12/22/2006 3:42:00 PM

0

Yes...It does render borders in IE...Really works nicely...The only minor
issue is that the first tablecell in the header does not have the same font
size as the other cells. I can live with that, but if you have any
suggestion, that would be terrific.

"JJ" wrote:

> Does it render borders if you open the page in IE?
>
> Tables are somewhat flaky on the BB. If things don't align right, try
> putting "width=X%" attributes in your <td> tags and try to use that to get
> spacing right.
>
> With the mobile forms, you are dealing with two forces - one is that the
> asp.net mobile form rendering engine will strip out some HTML elements
> (although it should not touch them in a DeviceSpecific section) and the
> other is the BB rendering.
>
> I see one problem in your code - you have the </table> within the
> ItemTemplate, which will get rendered for every row, so if you display more
> than one row, you will have too many </table> tags.
>
> If you are going to start a <table> in the <HeaderTemplate>, then you need
> to close the tag in the <FooterTemplate>, not in the <ItemTemplate>
>
>
> "Mark Gialo" <MarkGialo@discussions.microsoft.com> wrote in message
> news:9DD35E30-B4E7-49A9-8566-F0EDC3185865@microsoft.com...
> > JJ...i am not sure why the mobile web form below does not render borders.
> > My
> > ItemTemplate renders the columns properly, but the HeaderTemplate is not
> > allowing borders, and the columns are not lining up with the items being
> > rendered.
> >
> > <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Table.aspx.cs"
> > Inherits="Table" %>
> > <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls"
> > Assembly="System.Web.Mobile" %>
> >
> > <html xmlns="http://www.w3.org/1999/x... >
> > <body>
> > <mobile:Form id="Form1" runat="server">
> > <mobile:ObjectList ID="ObjectList1" Runat="server"
> > CommandStyle-StyleReference="subcommand"
> > LabelStyle-Reference="title">
> > <DeviceSpecific>
> > <Choice>
> > <HeaderTemplate>
> > <table border="2">
> > </HeaderTemplate>
> > <ItemTemplate>
> > <tr>
> > <td><asp:LinkButton id="LinkButton1" Width=100
> > Runat="server">
> > <%# ((ObjectListItem)Container)["dt_1"] %>
> > </asp:LinkButton></td>
> > <td><asp:LinkButton id="LinkButton2" Width=100
> > Runat="server">
> > <%# ((ObjectListItem)Container)["dt_2"] %>
> > </asp:LinkButton></td>
> > <td><asp:LinkButton id="LinkButton3"
> > Width=100Runat="server">
> > <%# ((ObjectListItem)Container)["dt_3"] %>
> > </asp:LinkButton></td>
> > <br></br>
> > </tr>
> > </table>
> > </ItemTemplate>
> > </Choice>
> > </DeviceSpecific>
> > </mobile:ObjectList>
> > </mobile:Form>
> > </body>
> > </html>
> >
> > "Mark Gialo" wrote:
> >
> >> My mobile application has three columns in an objectlist. When rendering
> >> this
> >> to a blackberry device, the text is wrapping signifying perhaps the font
> >> size
> >> or width of the control is too large.
> >>
> >> Is there any way to set a pixel size for the objeclist control? or
> >> perhaps
> >> another way to insure it renders properly.
>
>
>