Datagrid percent column

  • Thread starter Thread starter Chris Clement
  • Start date Start date
C

Chris Clement

I have a datagrid with a discount percent column that I need to be more
precise. Can anyone show me an example of how to format a single column
with a higher precision? Here is the code I am using right now:

this.dataGridTextBoxColumnDiscountPercent.Width = 65;

this.dataGridTableStyle1.GridColumnStyles.Add(this.dataGridTextBoxColumnDisc
ountPercent);
this.dataGridTextBoxColumnDiscountPercent.Format = "F";
this.dataGridTextBoxColumnDiscountPercent.FormatInfo = nfi;

Thanks.
 
Hi Chris,

Based on my understanding, you want to display your data in the
DataGridTextBoxColumn more precise.

Actually, DataGridTextBoxColumn.Format property use the common Format
Strings in .Net, for more information, please refer to:

"Standard Numeric Format Strings"
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconstandardnumericfor
matstrings.asp
"Custom Numeric Format Strings"
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcustomnumericforma
tstrings.asp

To extend the precision, you may use (#)"Digit placeholder" as a
placeholder for your digits. For an example, please refer to:
"Custom Numeric Format Strings Output Examples"
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcustomnumericforma
tstringsoutputexample.asp

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top