Hello,
I have a request to display and accept negative numbers as numbers with parenthesis, for example, (450) represents -450
Does InputMask property support parenthesis in mask?
Please help ...
Hi Mike, I actually need to do both, format the cell, and mask the input to accept parenthesis because they want to be able to paste the amounts from Excel, and see the negative values as numbers in parenthesis. Yes I agree, changing overriding the cell types doesn't make sense. I'm just not clear how and where I can convert that string to decimal. Thank you Mike.
You can't change the DataType of a column that is bound. The DataType is determined by the data source. The tree has to be able to write the cell values to the data source, so changing the data type doesn't make sense.
It's still not clear to me if you are trying to format the cell data or mask the input. Which one do you need to do?
Hello Mike,
On Infragistics.Win.UltraWinTree.TreeNodesCollection , if I have an object of this type, let's say
Infragistics.Win.UltraWinTree.TreeNodesCollection x;
x.SetDataBinding(someDataSource, null)
then if I enumerate like this:
foreach (var n in m_treeNodes) { n.Cells[8].Column.DataType = typeof(string); n.Cells[8].Value = "(100)"; }
let's say Cells[8] exists, even though I was able to assign a string type to the column, I still could not assign "(100)" to the cell because somehow the cell keeps its type as decimal from the datasource.
So in this case I would get a run time error: Object of type 'System.String' cannot be converted to type 'System.Decimal'
So what would it take for me to override this decimal type from datasource?
Sorry I didn't see your previous reply. Let me check to see if I can manually format the column as string, thank you!
Hi Mike, thank you! Yes I believe DataFilter would be useful. What I am trying to achieve is to allow the users to copy a column from Excel, which may contain parenthesis for the negative numbers, and paste onto UltraTree object in our Accounting UI.
So far, the problem is that the tree cell types are defined on databinding. So using string format as described in the links that you provided would not work for cell types that are of numeric types. I appreciate your time very much, thank you!