I can't simply set the x:Name attribute of the ComboBox because there are more than one. I also don't know how to get a specific ComboBox from code, to set/get the Text property. Here is a simplified version of my XAML file: <pre lang="XML"> <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <!-- its Page because i'm using Kaxaml --> <Page.Resources> <XmlDataProvider x:Key="PropertyData" XPath="/properties"> <x:XData> <!-- This is actually in an external xml file --> <properties xmlns=""> <property name="some property"> <item value="5" /> <item value="10" /> <item value="15" /> <item value="20" /> </property> <property name="other property"> <item value="5" /> <item value="10" /> <item value="15" /> <item value="20" /> </property> </properties> </x:XData> </XmlDataProvider> </Page.Resources> <ListView DataContext="{StaticResource PropertyData}" ItemsSource="{Binding XPath=property}"> <ListView.View> <GridView> <GridViewColumn Header="Property" DisplayMemberBinding="{Binding XPath=@name}" /> <GridViewColumn Header="Value"> <GridViewColumn.CellTemplate> <DataTemplate> <ComboBox Width="100" ItemsSource="{Binding XPath=item}" DisplayMemberPath="@value"></ComboBox> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> </GridView> </ListView.View> </ListView> </Page>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)