I have an UltraGrid bound to a DataTable with an Amount column of type double.
I have set the Column.Style to Double in addition to other properties.
col.Header.Caption = "Value";
col.SortIndicator = SortIndicator.Ascending;
col.Width = 150;
col.CellClickAction = AllowEdit ? CellClickAction.Edit : CellClickAction.RowSelect;
col.CellAppearance.BackColor = AllowEdit ? Color.LightYellow : _defGridBackColor;
col.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Double;
col.Nullable = Infragistics.Win.UltraWinGrid.Nullable.Disallow;
col.MaxLength = 20;
col.MaxValue = 1000000000000;
col.Format = "###,###,###,##0.#0";
col.PromptChar = '\0';
col.NullText = "None";
However, I am only able to enter a max value of 100,000,000.00 in the
column via the editor.
Setting MaxValue to say, 1 trillion, has no effect.
I can enter more than 100M if I set the MaskInput property. I wanted to know if there is another way of accomplishing this? MaskInput, for one, shows thousands placeholders, which I don't want.
Hi,
I tried this out and it seems to work fine for me.I am able to enter 1000000000000 (the MaxValue you posted in your code here) with no problems.
What do you mean when you say "I am only able to enter a max value of 100,000,000.00 in the column via the editor." What exactly happens when you try?
If I enter more than 8 zeros, the cursor skips to the right of the decimal point. If I paste in 1000,000,000 it gets truncated to 100,000,000.00.
Also, if I remove the column.Style = Double line, it allows me to enter more than 100,000,000, which is why I suspected it is related to the column style.
I guess I should mention that I am using v10.3.
Hello,
The style you are setting uses the masking functionality so if you want to control the number of digits and decimal places you will have to set the 'MaskInput' property.
Please do not hesitate to contact us if you need any additional assistance.
OK. Here is another question then.
Why is the col.MaxValue ignored? The documentation for MaxValue says nothing about being inapplicable when setting column.Style.
And why this arbitrary 100,000,000 limit? In financial apps, I guarantee that is going to be inadequate.
From the documentation for column.Style:
For example the CurrencyPositive style sets theUltraGridColumn.Editor to T:Infragistics.Win.EditorWithMask instance and the MinValueExclusive to 0. Also you can set these properties to further refine the behavior of a column style. This is because these properties take precedence over the Style property.
It seems like the MaxValue should override any built-in MaxValue used by the Double style which isn't happening?
I just wanted to know if you were able to solve your issue based on these suggestions or you still need help? Please let me know.
Just to clarify a little bit, the way the Style property of the column works is that it applies certain defaults to the column, such as a default editor with the some default property settings and also a default MaskInput. So in this case, the default mask only has a certain number of characters.
If you need more characters, you just have to change the MaskInput property to allow more - in addition to setting the Style.