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
1253
Focus
posted

Hi,

I have SL 3.0 installed and use VS2008.  I received this errror:

 Error: Unhandled Error in Silverlight Application
Code: 4004   
Category: ManagedRuntimeError      
Message: System.NullReferenceException: Object reference not set to an instance of an object.
   at Infragistics.Silverlight.Controls.XamWebMaskedEditor.OnGotFocus(RoutedEventArgs e)
   at System.Windows.Controls.Control.OnGotFocus(Control ctrl, EventArgs e)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)    

private void rdbTest_Checked(object sender, RoutedEventArgs e)
{
    txtSearch = FindName("txtSearch") as XamWebMaskedEditor;
    txtSearch.Visibility = Visibility.Visible;
    txtSearch.Focus ();

I don't understand why I received this error.  Can you help?  Thanks!

 

 

 

  • 495
    posted

    Hi tangolp,
    Unfortunately, this is a bug on the “XamWebMaskedEditor” if Visibility state is Collapsed - we will fix it as quickly as possible.

    To solve your case, you can:
    1.
    In XAML instead Visibility state, you can set  the Width/Height of the “XamWebMaskedEditor” to “0”.

    <igME:XamWebMaskedEditor x:Name="maskedEditor" Width="0"/>


     
    2. Change the Width/Height of the “XamWebMaskedEditor” in “rdbTest_Checked” method.

    private void rdbTest_Checked (object sender, RoutedEventArgs e)

    {

                XamWebMaskedEditor txtSearch = FindName("maskedEditor") as XamWebMaskedEditor;

                txtSearch.Width = 160;

     

                txtSearch.Focus();

    }

     

    Hope this help you
    Regards Tanya.