I have a grid that has a combo box to display possible values for the cell and a datecontrol. These 2 fields are optional.
Grid displays everything great when a value is selcted from the comboBox and a date from the date control.
But if nothing is selected then I see a 0(zero) for the cell that has the combo embedded and default date of 01/01/0001
I would like them to be blank when nothing has been selected....
Is there an easy way to achieve this?
Another problem I have with a decimal type cell is it always gets formatted to display a $ sign in front of the decimal value, how to format it so that I dont see the $ sign as my data is really laboratory data....
Thanks!
Hello,
For the XamDateTimeEditor you can set the NullText property ( and PadChar and PromptChar properties also) to get the desired look.
NullText will be the text displayed when there is no data in the editor and it is not in EditMode. When entering the Edit mode, the PromptChars will be displayed to prompt the user for the expected data that should be inserted. Like this:
<igEditors:XamDateTimeEditor Name="xamDateTimeEditor1" PromptChar="?" PadChar="/" NullText=" " >
You can try the same with the XamComboEditor.
About the $ sign please take a look at that link http://news.infragistics.com/forums/p/20591/74280.aspx#74280
Hope this helps and let me know if it works in your scenario.
Alex.
Alex,
I greatly appreciate your response.
I have tried the following:
<igDP:Field.Settings>
<igDP:FieldSettings EditorType="{x:Type igEditors:XamDateTimeEditor}">
<igDP:FieldSettings.EditorStyle>
<Style TargetType="{x:Type igEditors:XamDateTimeEditor}">
<Setter Property="PromptChar" Value="?" />
<Setter Property="PadChar" Value="/" />
<Setter Property="NullText" Value = " ">
</Style>
</igDP:FieldSettings.EditorStyle>
</igDP:FieldSettings>
</igDP:Field.Settings>
</igDP:Field>
But I really didn't see any difference. Is this the right way to do this?
Thanks
As it works in my scenario and not in yours, please send us a sample project with your scenario to be able to investigate it closely.
Is it possible to send me your sample for this so I can see what I am doing wrong?
I am really sorry. My last answer was not correct at all. These settings can be set only if the editor is not embedded in the XamDataGrid. It needs the default values ( as for date it is 01/01/0001 and for Combo (int or double - 0).
I came up with a workaround for this, changed the following line
<
igDP:Field Name="StatusUpdatedDate" Label="Last Status Date" ToolTipService.ToolTip="Last time status changed"/>
to....
igDP:UnboundField Name="StatusUpdatedDate" BindingPath="StatusUpdatedDate" Label="Last Status Date" ToolTipService.ToolTip="Last time status changed"/>
Basically changed the Field to an UnboundField, that fixed the issue for me.....
hope this helps someone having this problem with a default value of null in datetimecontrol field of a grid