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 Mike,
Please have a look @ the follwing example for the unbound / bound column issue.
1) Put the ultragrid on the form in windows application
2) Use following code in Formload or any button click vent handler
////Create the data table
DataTable table = new DataTable();
table.Columns.Add("Bound", typeof(double)); // type double
table.Columns.Add(
"Dummy2", typeof(int)); // type int
if (!ultraGrid1.DisplayLayout.Bands[0].Columns.Exists("UnBound"))
{
ultraGrid1.DisplayLayout.Bands[0].Columns.Add(
"UnBound"); // Adding unbound column
}
table.Rows.Add(12345.67, 12345);
ultraGrid1.DataSource = table;
ultraGrid1.Rows[0].Cells[2].Value = 12345.67;
ultraGrid1.DisplayLayout.Bands[0].Columns[1].MaskInput =
"nnnn";
ultraGrid1.DisplayLayout.Bands[0].Columns[0].MaskInput = "nnnn.nn";//bound column
ultraGrid1.DisplayLayout.Bands[0].Columns[2].MaskInput = "nnnn.nn";//Unbound column
Bound Dummy2 Unbound
2345.67 1234 1234.50
Now that is what decribes the problem with bound / unbound columns. Original value is 12345.67, In Bound column it is 2345.67 (Truncating 1 from front)
but in unbound column, it is 1234.50
Hi Sanjiv,
I don't see how bound or unbound could possibly make any difference. The editor that handles the masking gets the value of the cell from the grid. It does not know or care where the data comes from or whether the field is bound or not.
So there must be some other difference between the columns.
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.
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.