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
20
XamlDataGrid unable to display a long (Int64) value.
posted

I'm working with an existing database which has a field type of Int64 (bigint in SQL 2005).  When I try to display this value in the data grid I get some meaningless (to me anyway) value. 

 I've submitted this to Infragistics already and was given an incident number of XDG543 but was hoping perhaps the community can help me with a workaround.

 Attached is a very simple piece of code which demonstrates the issue.

 Thanks in adavnce!

 

 

TEST.zip
  • 2070
    posted

    Hi Corey,

     

    This is a bug in the numeric editor control. We've entered it into our bug tracking system and will soon be fixed. It only happens for Int64 data types.

    In the meantime, use the following workaround. It sets the correct mask on all Int64 fields.

    foreach ( Field field in xamDataGrid1.DefaultFieldLayout.Fields )

    {

    if ( typeof( Int64 ) == field.DataType )

    {

    Style style = new Style( typeof( XamMaskedEditor ) );style.Setters.Add( new Setter( XamMaskedEditor.MaskProperty, "-nnnnnnnnnnnnnnnnnnn" ) );

    style.Seal( );

    field.Settings.EditorStyle = style;

    }

    }

     

    Hope this helps,

    Sandip