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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      54 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      72 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      38 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      99 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      60 views
      0 likes
      Last Post PaulMohn  
      Working...
      X