Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form view pager 1

Status
Not open for further replies.

crabgrass

Technical User
Aug 29, 2007
111
US
This from a total newbie.

When using a formview, is it possible to change to appearance of the pager buttons to regular buttons rather than the default linkbuttons?

Thanks
 
yes, you can do this. See


The trick is to use the "pager template" of the formview, and to put your command buttons in there. And then, as the like shows, you need to set the button's CommandName Property to the value "Page" and the button's CommandArgument property to the value "Prev" or "Next". I also found these to be case sensitive.

thus, you could have something that looks like:
Code:
        <asp:FormView ID="FormView1" runat="server" AllowPaging="True" DataKeyNames="CompanyID" DataSourceID="SqlDataSource1">
            <PagerSettings Mode="NextPrevious" />
            <PagerTemplate>
                <asp:Button ID="Button3" runat="server" CommandArgument="Prev" CommandName="Page"
                    Text="back" />
                <asp:Button ID="Button4" runat="server" CommandArgument="Next" CommandName="Page"
                    OnClick="Button4_Click" Text="fwd" />
             </PagerTemplate>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top