Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Problem with Posting, Paging


Message #1 by "Adam Harris" <adam@w...> on Tue, 16 Apr 2002 03:10:22 -0400
Hello,

I am wearing this newsgroup out!  Sorry about all of the questions!  I have
created a datagrid with the ability to page the results.  I have at the top
of the page a input box where they can select how many rows they would like
to view at a time.  So when you click the 1 2 3 4 .... the page will post
back the number of rows in the text box.  My question is, how do I create a
button, or a hyperlink directly beside the Input box for the rows where I
can click it and the rows will update.  I don't think end users are going to
know to click the numbers at the bottom of the table.  I have provided some
code for further understanding:

<form runat="server">

   <font color="White"> Number of rows per Page:</font>
   <ASP:TextBox id="PageRows" runat="server" /> &nbsp;

**** this is where I want to put the link to update the number of rows ****
 <a id="Update"  title = "Click here to update rows" href
="javascript:__doPostBack('MyDataGrid:ctrl1:ctrl0','')"><font
color="#FFFFFF">Update</font></a>
   <p />
**** this is where I want to put the link to update the number of rows ****

   <ASP:DataGrid id="MyDataGrid" runat="server" allowsorting="true"
onsortcommand="sort"
        Width="70%"
  HeaderStyle-HorizontalAlign="Center"
  HeaderStyle-BackColor="#FFFFFF"
  ItemStyle-BackColor="#00FFCC"
  AlternatingItemStyle-BackColor="#ffff99"
  AutoGenerateColumns="false"
        AllowPaging="True"
  Font-Size ="8pt"
  PagerStyle-HorizontalAlign="Right"
  OnPageIndexChanged="ChangeGridPage"
  PagerStyle-Mode="NumericPages"
  PagerStyle-BackColor="white" >

  <columns>
 <asp:boundcolumn headertext="First Name" datafield = "fname"
sortexpression="fname"/>
    <asp:boundcolumn headertext="Last Name" datafield="lname"
sortexpression="lname"/>
 <asp:boundcolumn headertext="Addr 1" datafield="address1"
sortexpression="address1"/>
 <asp:boundcolumn headertext="Addr 2" datafield="address2"
sortexpression="address2"/>
 <asp:boundcolumn headertext="City" datafield="city" sortexpression="city"/>
 <asp:boundcolumn headertext="State" datafield="state"
sortexpression="state"/>
 <asp:boundcolumn headertext="Zip" datafield="postalcode"
sortexpression="postalcode"/>
 <asp:boundcolumn headertext="Country" datafield="country"
sortexpression="country"/>
 <asp:boundcolumn headertext="Email" datafield="email"
sortexpression="email" />
 <asp:boundcolumn headertext="phone" datafield="phonenumber"
sortexpression="phonenumber"/>


  </columns>



</asp:datagrid>

</form>

Thanks!

Adam Harris




  Return to Index