DEV financial currency format Cell

Source: Internet
Author: User

In financial software such as yonyou Kingdee, you often need to input data of the currency type. How should we prepare such input boxes?

Extend the functionality of the DataGridView from the skysky flying blog http://www.cnblogs.com/michaelhuwei/archive/2010/07/07/1772965.html

If you want to use the DEV control XtraGrid to achieve the same effect

You need to implement two GridView events: CustomDrawCell and CustomDrawFooterCell.

The effect is as follows:

The implementation code is as follows:

Draw Cell currency format line

   P_WIDTH =  fe =  formatStr =  (e.Column.FieldName ==                 (e.Column.ColumnEdit != = (e.Column.ColumnEdit.DisplayFormat = formatStr.Substring(formatStr.IndexOf() + = (e.Column.DisplayFormat = formatStr.Substring(formatStr.IndexOf() +                  ( i = ; i < (e.Bounds.Width / ) - fe; i++ (i %  == + i * P_WIDTH, + i *+ i * P_WIDTH, + i *+ ((e.Bounds.Width / ) - fe) * P_WIDTH, , e.Bounds.Left + ((e.Bounds.Width / ) - fe) * (fe >  ( j = ; j < fe - ; j+++ ((e.Bounds.Width / ) - fe++j) * P_WIDTH, , e.Bounds.Left + ((e.Bounds.Width / ) - fe++j) *                 sf = == v = s_int = ((                 s_dec = formatStr.ToString().Substring(formatStr.ToString().IndexOf()+ s_value = s_int + ( i = ; i < s_value.Length; i++ ch = s_value[s_value.Length - i -  x = e.Bounds.Left + ((e.Bounds.Width / ) - i - ) * y = rect = = 
  gridView1_CustomDrawCell(

Draw summary currency format line

    P_WIDTH =  fe =  formatStr =  (e.Column.FieldName ==                 (e.Column.ColumnEdit != = (e.Column.ColumnEdit.DisplayFormat = formatStr.Substring(formatStr.IndexOf() + = (e.Column.DisplayFormat = formatStr.Substring(formatStr.IndexOf() +                  ( i = ; i < (e.Bounds.Width / ) - fe; i++ (i %  == + i * P_WIDTH, + i *+ i * P_WIDTH, + i *+ ((e.Bounds.Width / ) - fe) * P_WIDTH, , e.Bounds.Left + ((e.Bounds.Width / ) - fe) * (fe >  ( j = ; j < fe - ; j+++ ((e.Bounds.Width / ) - fe +  + j) * P_WIDTH, , e.Bounds.Left + ((e.Bounds.Width / ) - fe +  + j) *                 sf = == v = s_int = ((                 s_dec = formatStr.ToString().Substring(formatStr.ToString().IndexOf() +  s_value = s_int + ( i = ; i < s_value.Length; i++ ch = s_value[s_value.Length - i -  x = e.Bounds.Left + ((e.Bounds.Width / ) - i - ) * y = rect = = 
  gridView1_CustomDrawFooterCell(

 

 

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.