How to display the value of a NumericUpDown Cell in Hex, Dec, Oct and Bin formats?

Hi, I have a gridControl that has a NumericUpDown cell, I need to show the value in Hex format(0x1d2c), Decimal format(234), Octal format(343) or binary format(010101) according to user preference, how can I do this? Thanks -Dongxian Li

4 Replies

AD Administrator Syncfusion Team June 9, 2005 12:10 AM UTC

You will have to derive a cell control to manage this. I do not have a sample for this, but here is a link to derived cell numericupdown that supports decimal increments. http://www.syncfusion.com/support/user/uploads/fractionnumericupdown.zip This shows how you can tweak the behavior using s derived numericupdown celltype.


ER Eric June 22, 2006 03:07 AM UTC

Hi, I used this model and it works fine. But the problem is we can''t type in decimal values into this control (up down button works fine but user sometimes may overtype a decimal number in), is that anyway we can support this as well? Million thx! Eric >Hi, >I have a gridControl that has a NumericUpDown cell, I need to show the value in Hex format(0x1d2c), Decimal format(234), Octal format(343) or binary format(010101) according to user preference, how can I do this? > >Thanks >-Dongxian Li >


ER Eric June 22, 2006 03:11 AM UTC

Hi, I used this model and it works fine. But the problem is we can''t type in decimal values into this control (up down button works fine but user sometimes may overtype a decimal number in), is that anyway we can support this as well? Million thx! Eric >Hi, >I have a gridControl that has a NumericUpDown cell, I need to show the value in Hex format(0x1d2c), Decimal format(234), Octal format(343) or binary format(010101) according to user preference, how can I do this? > >Thanks >-Dongxian Li >


AD Administrator Syncfusion Team June 22, 2006 07:13 PM UTC

Hi Eric, Could you try this code to accept the decimal Keystrokes in a FractionNumericUpDown Cell. Here is a code snippet //in FNumericUpDownCellRenderer class protected override void OnKeyPress(System.Windows.Forms.KeyPressEventArgs e) { base.OnKeyPress(e); //digits only in column2 if(!char.IsDigit(e.KeyChar)) { if( e.KeyChar != ''.'' ) e.Handled = true; } } Here is a modified sample. http://www.syncfusion.com/Support/user/uploads/FractionNumericUpDown_797cf5a.zip Let me know if this helps. Best Regards, Haneef

Loader.
Up arrow icon