Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ash 8 posts 28 karma points
    Apr 13, 2011 @ 11:21
    Ash
    0

    get the value of the selected checkbox property as an int

    Hi, I've been trying to work out thow to get the value of a selected checkbox within an after save eventhandler. I can get it as a string:

     

    string selectedParentIdAsString = 
    sender.getProperty("jobClassification").Value.ToString();
  • Ash 8 posts 28 karma points
    Apr 13, 2011 @ 12:11
    Ash
    0

    Ok, I found a solution from trial and error:

    int selectedParentId = Convert.ToInt32(sender.getProperty("jobClassification").Value);
    sender.Move(selectedParentId);

    I'd still be interested in any other approaches, if they exist?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Apr 13, 2011 @ 12:30
    Dirk De Grave
    0

    Property .Value of a document property always returns an object, so you need to cast it before using it. And btw, you may run into an exception if no value has been selected in the checkbox list, so try using TryParse() instead of Convert.ToInt32() which will throw an exception for an empty value.

     

    Cheers,

    /Dirk

Please Sign in or register to post replies

Write your reply to:

Draft