Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Setting AccountSelector selected value

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Setting AccountSelector selected value

    I use the AccountSelector on a custom indicator. And I store the selected account in an indicator property set to type account. I want to use this property so that when the chart is refreshed, the selected account defaults back to what it was before the refresh.

    I have tried all of these methods below:

    accountSelector.SelectedAccount
    accountSelector.SelectedIndex
    accountSelector.SelectedItem
    accountSelector.SelectedValue
    accountSelector.DesiredAccount

    But nothing seems to work. The AccountSelector keeps defaulting to Sim101. How can I set the desired account in the AccountSelector?

    Thanks!


    #2
    Hello martyn73,

    Thank you for the question.

    This should be the DesiredAccount property if you are trying to set this value during the creation of the selector. Here is an example from the addon basic sample in the help guide, I have added changing to another sim account:

    Code:
    accountSelector = LogicalTreeHelper.FindLogicalNode(pageContent, "accountSelector") as AccountSelector;                    
    accountSelector.DesiredAccount = "SimAccount1";
    If you are trying to set the value later or in an event handler of some kind, that may be the problem. Are you setting this value right after creating the account selector?


    I look forward to being of further assistance.

    Comment


      #3
      Perfect, that works. I was trying to set it later which was the problem. Thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      571 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      331 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      549 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      550 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X