ObjectList pagination

Last post 06-26-2009 9:16 AM by take. 2 replies.

Sort Posts:

  • ObjectList pagination

    09-18-2007, 10:44 AM
    • Member
      58 point Member
    • xesteban
    • Member since 08-30-2006, 11:51 AM
    • Posts 30

    Hi,

    I use an ObjectList inside a Mobile Web Form. This Form has Controls located before and after the ObjectList.

    I have the following problem:

    If the query returns 10 pages for example, when I move trough the pages, the other Controls are not visible. I mean, in the first page I only display the Controls located before the ObjectList and the ObjectList. And in the last page I only display the Controls located after the ObjectList and the ObjectList. When I am in pages 2 to 9, I only display the registers in the ObjectList.

    Is not possible to paginate as the WebControls.DataGrid do it?

    Thank you very much.

  • Re: ObjectList pagination

    09-21-2007, 7:00 AM
    Answer

    Hi xesteban,

    ObjectList templates can be used in such situation. HeaderTemplate, FooterTemplate render at top and bottom of the page respectively when you enable pagination, the templates render at the head and bottom of each page.

            <mobile:ObjectList ID="ObjectList2" Runat="server" CommandStyle-StyleReference="subcommand"
                DefaultCommand="Command1" LabelStyle-StyleReference="title" OnLoadItems="ObjectList_LoadItems"
                ItemCount="20">
                <DeviceSpecific>
                    <Choice Filter="isHTML32" Xmlns="http://schemas.microsoft.com/mobile/html32template">
                        <HeaderTemplate>
                            <mobile:Label ID="Label1" Runat="server">Header</mobile:Label>
                        </HeaderTemplate>
                        <FooterTemplate>
                            <mobile:Label ID="Label2" Runat="server">Footer</mobile:Label>
                        </FooterTemplate>
                        <ItemTemplate>
                            <mobile:Label ID="Label3" Runat="server">
                                <%#((ObjectListItem)Container)["id"]%>
                            </mobile:Label>
                            </mobile:TextBox>                   
                       
    </ItemTemplate>
                    </Choice>
                </DeviceSpecific>
            </mobile:ObjectList>

     

    Zhao Ji Ma
    Sincerely,
    Microsoft Online Community Support

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • Re: ObjectList pagination

    06-26-2009, 9:16 AM
    • Member
      4 point Member
    • take
    • Member since 05-16-2006, 12:26 PM
    • Posts 2

    zhao,

    I am also facing the same problem. putting the contorls in the header template section does resolve the controls bieng disapeared. But you can not change their value dynamically(at the code behind) the controls will be invisible at the code behind even the findcontrol method does not work. I need to put out of the the header/footer template that way only I can play on the controls property value at run time.

    And also I need the paginated Next and Previouse buttons appear at the top of the list....now it only position it at the bottom. Can you please send me how to do that if you already resolve that?

    THanks.

Page 1 of 1 (3 items)