Hi Infragistics team,
I have a UltraWin Grid in my application where there are 2 types of columns Bound
and Unbound. I have a masking set to nnnn for both the columns.
Issue: In bound columns the value that is coming is of 10 digits and due to masking(nnnn)
the significant digits from from (left) of the figure is getting truncated where as in unbound
column, it is getting truncated from Trailing side which is fine and that is what required in
bound columns also. Any Quick fix will be appreciated.
Regards,
Sanjiv
Hi Sanjiv,
I doubt this has anything to do with the columns being bound or unbound. My guess is that the columns you are looking at are using different DataTypes.
Check the DataType property on each column at run-time.
Hi Mike,
Gud to hear from you.
Actually the underlying data type is double. Although the masking is "nnnn".
Actually why I brought up the bound / unbound issue because in bound column, it is trunctaing the
figure from front chopping off the significant digits and in unboud columns it is trunctaing the value
from trailing side that is what required.
In unbound column there is no data type set explicitly may be that is behaving in the right manner.
Okay, as I said, the problem here has nothing to do with bound or unbound.
The issue is that you are never setting the DataType on the unbound column. It therefore defaults to String. So the difference you are seeing here is the difference between a numeric column and a string column.
Set the DataType on the unbound column to double or int and it will work the same as the bound columns do.
Agreed!!! Even I also figured out that yesterday about default set to string.
So what i need is the way so that the figure should only get truncated from trailing side.
I tried 9999.99 and it worked fine(trailing side gets truncated) for both the cases bound / unbound.
But the issue with the 9999.99 format is when I enter the value in cell in edit mode say like the
value is 12.55 then it appears like 12 .55 even though it appears correctly after exiting from cell i.e. 12.55
I do not understand. Are you saying that you want the bound columns to behave like they are strings?
There's no way to do that directly. But you could create unbound columns for each of your numeric columns and then hide the numeric columns from the user. Then you would use the InitializeRow event to copy the value of the real numeric column into the unbound (string) column.
I can't make unbound columns as it will not fulfill my requirements.
Any ways, I just want to know one thing why is 9999.99 and nnnn.nn is different in truncation. i think they should behave like same. OR Is there any other difference between them which is why value gets truncated from trailing side in 9999.99 and it act same for double and string type
But in nnnn.nn, value gets truncated from front and it is different for string and double.
There is a difference between '9' and 'n'. The 'n' indicates a number section. So a group of n's is treated as a group, whereas a '9' is just a single character which is not tightly tied to the other 9's adjacent to it.