Hi,
I have a bound column for which i have set the Mask Input property to "-nnnnn.nn" (decimal) and Mask DataMode as Raw. Now, for that column the cell value that is displayed is 0.00. I don't want to show 0.00 as default value. On entering edit mode, i can show the mask. Is there a property to do this ?
Hello Viswanth,
The behavior that you describe could be caused if your T source class (BindingList< of T>), has a decimal field (property), which is not Nullable. Then the editor will display 0.00 if there is no value in the cell. Please see the attached sample where I have a class MyClass with two properties of decimal type, first is Nullable and second is not.
Please let me know if you have any further questions.
I'm using Infragistics v10.3 and have not set column style property. My datasource is a
BindlingList<of T>. Below is all i do in InitializeLayout of the grid.
band.Columns["myColumn"].Header.Caption = "MD"; band.Columns["myColumn"].Header.VisiblePosition = 1; band.Columns["myColumn"].Nullable = Infragistics.Win.UltraWinGrid.Nullable.Nothing; band.Columns["myColumn"].MaxValue = 99999.99; band.Columns["myColumn"].MaxLength = 10; band.Columns["myColumn"].MaskDataMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.Raw; band.Columns["myColumn"].MaskInput = "-nnnnn.nn"; band.Columns["myColumn"].Width = 60;
What is the type of your UltraGridColumn? What kind of DataSource you are using?
I have tried the following approach and I am not seing 0.00 as a default value.
DataTable dt = new DataTable(); dt.Columns.Add("Money", typeof(decimal)); dt.Rows.Add();
Nothing is displayed in the UltraGrid, when you click on the cell, you are entering edit mode and than the mask is displayed as it supposed to be.
What version of the Infragistics controls you are using ?
Valkov,
What i'm looking for is NOT to display 0.00 if the cell doesn't have any data. Since i have the mask enabled, for all the cells, it shows 0.00 as default value. Can i override this and just display empty cells ? . The other option that i'm looking for is to display the 0.00 only if user enters edit mode.
If you would like to show the MaskPrompt chars when the cell is not in edit mode you could do the following for your column:
.MaskDisplayMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludePromptChars; or
.MaskDisplayMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeBoth;
Please feel free to let me know if this is not what you are looking for.