How to populate vsct combo (B) based on the value chosen in combo (A)
Hugo Machado
1
Reputation point
I am developing an extension for Visual Studio 2022 and I have two vsct combos of type DynamicCombo added in my extension's toolbar:
<Combos>
<Combo guid="guidPackageCmdSet" id="comboA" priority="0x0012" type="DynamicCombo" defaultWidth="240" idCommandList="comboAGetList">
<Parent guid="guidPackageCmdSet" id="TWToolbarGroup"/>
<CommandFlag>IconAndText</CommandFlag>
<CommandFlag>CommandWellOnly</CommandFlag>
<Strings>
<ButtonText>Combo A: </ButtonText>
</Strings>
</Combo>
<Combo guid="guidPackageCmdSet" id="comboB" priority="0x0013" type="DynamicCombo" defaultWidth="240" idCommandList="comboBGetList">
<Parent guid="guidPackageCmdSet" id="TWToolbarGroup"/>
<CommandFlag>IconAndText</CommandFlag>
<CommandFlag>CommandWellOnly</CommandFlag>
<Strings>
<ButtonText>Combo B: </ButtonText>
</Strings>
</Combo>
<Combos>
I've created commands for each combobox to load values and handle the on change event.
- Is there any way to populate the comboB after changing the value on comboA? I need to populate the comboB based on the value chosen in comboA. Is that possible?
- Is it possible to load these combos with an array of my objects? I would need to display a NAME but when I change the value, I need its ID.
Thanks in advance.
Sign in to answer