Asp.net: technology related to the gridview (5-solution for too long fields bound to the template column)

Source: Internet
Author: User

The idea is as follows:

Determine the columns to be monitored. When more than one limit value is exceeded, the corresponding operation can be taken. For example, when the value of the field bookid is 123456789, to limit the length of characters,

It can be displayed as 12345 ...... when you move the mouse over the field, all values are displayed as 123456789

 

The method is as follows:
1 <itemtemplate>
2 <asp: Label runat = "server" text = '<% # eval ("bookid"). tostring (). length> 5? Eval ("bookid "). tostring (). substring (0, 5) + "": eval ("bookid") %> 'tooltip = '<% # eval ("bookid") %>'
3 id = "label1"> </ASP: Label>
4 </itemtemplate> and aboveCodeLimit the number of font strings to 5


5 <% # eval ("bookid"). tostring (). length> 5? Eval ("bookid"). tostring (). substring (0, 5) + "": eval ("bookid") %>'
When you place the cursor over the field, all values are displayed. tooltip = '<% # eval ("bookid") %>'

Related Article

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.