Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7129259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:13:26+00:00 2026-05-28T11:13:26+00:00

Ok, a bit of a strange one – and it’s probably something simple as

  • 0

Ok, a bit of a strange one – and it’s probably something simple as I’m pretty new to Silverlight!

I have an object with the following property:-

private int targetID = NULL_TARGET_VALUE;
    [Display(Name="Target", Order=1)]
    [Required]
    public int TargetID
    {
        get
        {
            return targetID;
        }
        set
        {
            if (this.targetID != value)
            {
                this.ValidateProperty("TargetID", value);

                this.targetID = value;

                this.RaisePropertyChanged("TargetID");
            }
        }
    }

This object is created using the DataForm from the toolkit. I use the AutoGeneratingField event to change the item to a combo box drop down with the code below:

if (e.PropertyName == "TargetID")
        {
            ComboBox target = new ComboBox() { DisplayMemberPath = "Title", SelectedValuePath = "ItemID" };
            target.ItemsSource = TaskManager.Manager.GanttItemSource;
            var selectedItem = TaskManager.Manager.GanttItemSource.FirstOrDefault(p => p.ItemID == ParentTargetID);
            target.SelectedItem = selectedItem;
            e.Field.ReplaceTextBox(target, ComboBox.SelectedValueProperty, binding => binding.Converter = new TargetNullValueConverter());
            break;
        }

This does result in a drop down as I would expect. On my save button event I have this code:

if (registerForm.ValidateItem())
        {
            this.task.Save();
        }

If the debugger is attached to the silverlight project this works great. If it’s not then ValidateItem returns false as it thinks I have added an invalid target (“Input is not in a correct format” is the exact validation error I get).

Any ideas really appreciated! (BTW Just to confirm this happens in both release and debug build modes, simply attaching or removing a debugger causes this to occur)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T11:13:27+00:00Added an answer on May 28, 2026 at 11:13 am

    Dammit, the issues was down to this line in the autogeneratingfield event:-

    e.Field.ReplaceTextBox(target, ComboBox.SelectedValueProperty, binding => binding.Converter = new TargetNullValueConverter());
    

    This allows it to work

                                e.Field.ReplaceTextBox(target, ComboBox.SelectedValueProperty);
    

    Which makes sense because I’m dealing with ints not objects. Still don’t know why it works with the debugger attached however!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This a bit of strange one.... We have an internal web app that runs
This is a bit of a strange one but I've just seen something on
Bit of a strange one here, i have a CCTV system and contacted the
This one may be a bit strange. I have a solution in Visual Studio
I realize this one is a bit strange, so I'll explain. For a simple
Bit of a strange one this. Please forgive the semi-pseudo code below. I have
So here is a bit of a strange one... I have a stored proc
This is a bit of a strange one, but I've been struggling for a
I have a feeling my problem is a bit strange, but here goes... I
In the following code, this line is a bit strange to me: var x=document.forms[myForm][fname].value;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.