How to Use gridview to help you set data display skills

Source: Internet
Author: User

<Asp: gridview id = "grdlist" runat = "server" autogeneratecolumns = "false" width = "100%"
Datakeynames = "salesorderid" onrowdatabound = "grdlist_rowdatabound" allowpaging = "true" pagesize = "50" onpageindexchanging = "grdlist_pageindexchanging">
<Columns>
<Asp: hyperlinkfield target = "_ blank" datatextfield = "salesnum" headertext = "Order No.">
<Headerstyle width = "60px"/>
</ASP: hyperlinkfield>
<Asp: boundfield headertext = "order status" datafield = "statename">
<Headerstyle width = "60px"/>
</ASP: boundfield>
<Asp: boundfield headertext = "customer No." datafield = "customernum">
<Headerstyle width = "60px"/>
</ASP: boundfield>
<Asp: boundfield headertext = "name" datafield = "Consignee">
<Headerstyle width = "60px"/>
</ASP: boundfield>
<Asp: templatefield headertext = "phone">
<Itemtemplate>
<Asp: linkbutton id = "lktel" runat = "server" text = "******"> </ASP: linkbutton>
</Itemtemplate>
<Controlstyle width = "60px"/>
</ASP: templatefield>
<Asp: templatefield headertext = "Mobile Phone">
<Itemtemplate>
<Asp: linkbutton id = "lkmob" runat = "server" text = '*******'> </ASP: linkbutton>
</Itemtemplate>
<Controlstyle width = "60px"/>
</ASP: templatefield>
<Asp: boundfield headertext = "shipping address" datafield = "Address">
<Controlstyle width = "50%" type = "codeph" text = "/codeph"/>
<Itemstyle cssclass = "gvaddress"/>
</ASP: boundfield>
<Asp: boundfield headertext = "total amount" datafield = "amount" dataformatstring = "{0: N2}">

<Itemstyle cssclass = "gvamount"/>
</ASP: boundfield>
<Asp: boundfield headertext = "" datafield = "acceptname">
<Headerstyle width = "45px"/>
</ASP: boundfield>
<Asp: boundfield headertext = "Order Date" datafield = "salesdate" dataformatstring = "{0: yyyy-mm-dd}">
<Headerstyle width = "80px"/>
</ASP: boundfield>
<Asp: templatefield headertext = "operation">
<Itemtemplate>
<Asp: hyperlink id = "hyperlink1" navigateurl = '<% # "salesedit. aspx? Id = "+ eval (" salesorderid ") %>'
Target = "_ blank" runat = "server"> edit </ASP: hyperlink>
</Itemtemplate>
<Controlstyle width = "30px"/>
</ASP: templatefield>
</Columns>
<Rowstyle cssclass = "gvrow" backcolor = "white"/>
<Headerstyle cssclass = "gvheader"/>
<Alternatingrowstyle cssclass = "gvalternatingrow" backcolor = "# f4f4f4"/>

<Pagersettings pagebuttoncount = "30"/>
</ASP: gridview>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.