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(