Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
355
XamComboEditor ..how to bind multiple lists to same control in the program ?
posted

Hi ,

I am really new to WPF infragistics. I have an XamComboEditor that needs to have one out of 4 different lists as its ItemsSource based on a user event . Initially in the constructor of my code behind , I am setting the ItemsSource to one of the 4 lists right after InitializeComponent.

When I run the app , it adds 1,2,3... numbers to my XamComboEditor instead of the List I porvided.

Could you help me do this ? Is there any setting I need to override .

My XAML :

<ig:XamComboEditor ItemsSource="{Binding Attributes}" AllowMultipleSelection="True" CheckBoxVisibility="Visible" Name="XamComboEditor" HorizontalAlignment="Left" Margin="559,241,0,0" VerticalAlignment="Top" Width="171"/>

I should not want to set ItemsSource in XAMl since I will keep changing it based on user selection.

My code behind  constructor:

public MainWindow()
{
List<string> Attributes =new List<string> // one of the 4 lists
{
"Name",
"Client",
"Country",
"Field",
"Geomarket",
"Area",
"Formation Types",
"Fluid Types",
"Drive Mechanisms",
"EOR Processes"
};

InitializeComponent();

XamComboEditor.ItemsSource = Attributes;

}

On debugging I found that it sets up the item source all right. but later on it gets overriden by numbers , which I couldn't track where it got those from.

Regards,

Prasaanth

Parents Reply Children