Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
sorting problem !
posted
Hi, I have a field called "Close Price" that takes double values. But if close price is not available then I need to display "N.A". This is affecting sorting; it throws an exception when I try to sort. Is there work around it ? Thanks, Ramki
Parents
No Data
Reply
  • 2677
    posted

    Hello,

     To solve this problem, you will have to set the nullText property on the editor. 

    <igDP:Field Name="Department" Label="Department">
                                <igDP:Field.Settings>
                                    <igDP:FieldSettings>
                                        <igDP:FieldSettings.EditorStyle>
                                            <Style TargetType="{x:Type igEditors:XamNumericEditor}">
                                                <Setter Property="NullText" Value="N.A"></Setter>
                                            </Style>
                                        </igDP:FieldSettings.EditorStyle>
                                    </igDP:FieldSettings>
                                </igDP:Field.Settings>
                            </igDP:Field>

    If you want to do it in code, you can do the following:

    Style s = new Style(typeof(XamNumericEditor));
    s.Setters.Add(new Setter(XamNumericEditor.NullTextProperty,"N.A"));
    this.XamDataGrid1.FieldLayouts[0].Fields["Department"].Settings.EditorStyle = s;

    Hope this helps.

    Remember, if you are bound to a collection of objects, the double will have to be nullable or else you will not be able to blank out the values upon editiing them.

Children
No Data