How to realize the mouse movement of GridView data in asp.net to display prompt information
This article mainly explains "how to realize the mouse movement of GridView data in asp.net to display prompt information", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "how to achieve GridView data in asp.net mouse move to display prompts" it!
The question is:
In asp.net development, if there is such a requirement, if the value of a calculation formula is displayed in a list control, such as a column in GridView, then the demand comes and the mouse moves into the number to display the calculation formula and process of the number.
Solution Analysis:
In general, you can use the title property of the control to display prompt messages, but the style of the display information is not beautiful. Next, we can use such a solution, which is shown in the following figure:
Detailed implementation steps:
1. Download the js package related to the pop-up prompt box at http://download.csdn.net/detail/taomanman/9083213
2. Extract the downloaded files and put the entire popTips folder under your project directory, for example, under the js folder.
3. Introduce the relevant files into the page you need, the most important of which are the following files:
4. If GridView is used in the page, we can use the template column, as shown below:
......
5. Add a method to the background cs code
# region discount coal calculation formula shows 2015-09-06 / public string showZBMGS (string dian, string reli, string yuanmei, string tianranqi, string qiyou, string chaiyou) String zsny) {double zbm = (double.Parse (dian) * 0.1229) + (double.Parse (reli) * 0.0341) + (double.Parse (yuanmei) * 0.7143) + (double.Parse (tianranqi) * 1.2143) + (double.Parse (qiyou) * 1.4714) + (double.Parse (chaiyou) * 1.4571) + (double.Parse (zsny) * 1)) * 10 ZBMGS = "converted coal = electricity * 0.1229 + thermal * 0.0341 + raw coal * 0.7143 + natural gas * 1.2143 + gasoline * 1.4714 + diesel * 1.4571 + renewable energy * 1 =" ZBMGS + = dian + "* 0.1229 +" + reli + "* 0.0341 +" + yuanmei + "* 0.7143 +" + tianranqi + "* 1.2143 +" + qiyou + "* 1.4714 +" + chaiyou + "* 1.4571 +" + zsny + "* 1 ="; ZBMGS + = Math.Round (zbm, 2); return ZBMGS;} # endregion
6. Next, when the page is loaded, apply this information prompt, as shown in the following code:
(function () {/ / add information hints for the control 2015-09-06$ cb = $('#'). Find ('span [id $= "zbm"]'); $($cb). Poshytip ();}). At this point, I believe you have a deeper understanding of "how to realize the mouse movement of GridView data in asp.net to display prompts". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!