From: Gerhard on
Thank you. I will try that.

Have a happy day!

"Mr. Arnold" wrote:

> Gerhard wrote:
> > Specifics please
> >
>
> Just go to the forum and post there where you might get an answer.
> .
>
From: Gerhard on
Thanks, I have emailed you a simplified version of the project with just the
combo box added.

"Allen Chen-MSFT" wrote:

> Hi Gerhard,
>
> Could you please send me your project for me to reproduce this issue?
> (including DB file, remove sensitive information) Please send the project to
> allenc at microsoft.com and keep the project as simple as possible.
>
> Regards,
> Allen Chen
> Microsoft Online Support
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg(a)microsoft.com.
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
>
> Note: MSDN Managed Newsgroup support offering is for non-urgent issues where
> an initial response from the community or a Microsoft Support Engineer within
> 2 business day is acceptable. Please note that each follow up response may
> take approximately 2 business days as the support professional working with
> you may need further investigation to reach the most efficient resolution.
> The offering is not appropriate for situations that require urgent, real-time
> or phone-based interactions. Issues of this nature are best handled working
> with a dedicated Microsoft Support Engineer by contacting Microsoft Customer
> Support Services (CSS) at
> http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Gerhard" wrote:
>
> > I am posting this again at request of Microsoft concierge.
> >
> > I have downloaded and installed both VS2010 RC and Silverlight 4 RC. In
> > testing out functionality, I built a simple RIA Business Application against
> > the Chinook database. I have a datagrid with the albums, another datagrid
> > with the tracks that ties to the selected album, and a combobox that ties to
> > the selected album's artist. When I do my first filter (using the built in
> > filter text box), all works fine, but if I change the filter, the combobox no
> > longer stays in sync (the datagrid does though). Can you please help? XAML
> > is as follows:
> >
> > <navigation:Page
> > x:Class="Chinook.Home"
> > xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
> > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
> > xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
> > xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
> >
> > xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
> > mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
> > Style="{StaticResource PageStyle}"
> >
> > xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
> > xmlns:my="clr-namespace:Chinook.Web.Services"
> > xmlns:my1="clr-namespace:Chinook.Web.Models"
> > xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
> > DataContext="{Binding}">
> > <sdk:Page.Resources>
> > <CollectionViewSource x:Key="albumTracksViewSource" Source="{Binding
> > Path=Data.Tracks, ElementName=albumDomainDataSource1}" />
> > </sdk:Page.Resources>
> > <Grid x:Name="LayoutRoot">
> > <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource
> > PageScrollViewerStyle}" Margin="-58,0,-58,-10">
> >
> > <StackPanel x:Name="ContentStackPanel" Style="{StaticResource
> > ContentStackPanelStyle}">
> >
> > <TextBlock x:Name="HeaderText" Style="{StaticResource
> > HeaderTextStyle}"
> > Text="{Binding
> > Path=ApplicationStrings.HomePageTitle, Source={StaticResource
> > ResourceWrapper}}"/>
> > <TextBlock x:Name="ContentText" Style="{StaticResource
> > ContentTextStyle}"
> > Text="Home page content"/>
> > <riaControls:DomainDataSource
> > AutoLoad="True"
> > d:DesignData="{d:DesignInstance my1:Artist,
> > CreateList=true}"
> > Height="0" LoadedData="artistDomainDataSource_LoadedData"
> > Name="artistDomainDataSource"
> > QueryName="GetArtistsQuery"
> > Width="0">
> > <riaControls:DomainDataSource.DomainContext>
> > <my:ChinookContext />
> > </riaControls:DomainDataSource.DomainContext>
> > </riaControls:DomainDataSource>
> > <ComboBox Height="27"
> > Name="comboBox1"
> > Width="398"
> > ItemsSource="{Binding}"
> > DataContext="{Binding
> > ElementName=artistDomainDataSource, Path=Data}"
> > DisplayMemberPath="Name"
> > SelectedValuePath="ArtistId"
> > SelectedValue="{Binding ElementName=albumDataGrid,
> > Path=SelectedItem.ArtistId, Mode=TwoWay}" />
> > <riaControls:DomainDataSource
> > AutoLoad="False"
> > d:DesignData="{d:DesignInstance my1:Album,
> > CreateList=true}"
> > Height="0"
> > LoadedData="albumDomainDataSource_LoadedData"
> > Name="albumDomainDataSource"
> > QueryName="GetAlbumsByStartQuery"
> > Width="0">
> > <riaControls:DomainDataSource.DomainContext>
> > <my:ChinookContext />
> > </riaControls:DomainDataSource.DomainContext>
> > <riaControls:DomainDataSource.QueryParameters>
> > <riaControls:Parameter ParameterName="startString"
> > Value="{Binding ElementName=startStringTextBox, Path=Text}" />
> > </riaControls:DomainDataSource.QueryParameters>
> > </riaControls:DomainDataSource>
> > <StackPanel Height="30" Orientation="Horizontal">
> > <sdk:Label Content="Start String:" Margin="3"
> > VerticalAlignment="Center" />
> > <TextBox Name="startStringTextBox" Width="60" />
> > <Button Command="{Binding Path=LoadCommand,
> > ElementName=albumDomainDataSource}" Content="Load" Margin="3"
> > Name="albumDomainDataSourceLoadButton"
> > Click="albumDomainDataSourceLoadButton_Click" />
> > </StackPanel>
> > <sdk:DataGrid AutoGenerateColumns="False" Height="200"
> > ItemsSource="{Binding ElementName=albumDomainDataSource, Path=Data}"
> > Name="albumDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected"
> > Width="400">
> > <sdk:DataGrid.Columns>
> > <sdk:DataGridTextColumn x:Name="albumIdColumn"
> > Binding="{Binding Path=AlbumId}" Header="Album Id" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="artistIdColumn"
> > Binding="{Binding Path=ArtistId}" Header="Artist Id" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="titleColumn"
> > Binding="{Binding Path=Title}" Header="Title" Width="SizeToHeader" />
> > </sdk:DataGrid.Columns>
> > </sdk:DataGrid>
> > <riaControls:DomainDataSource
> > AutoLoad="True"
> > d:DesignData="{d:DesignInstance my1:Track,
> > CreateList=true}"
> > Height="0"
> > LoadedData="trackDomainDataSource_LoadedData"
> > Name="trackDomainDataSource"
> > QueryName="GetTracksQuery"
> > Width="0">
> > <riaControls:DomainDataSource.DomainContext>
> > <my:ChinookContext />
> > </riaControls:DomainDataSource.DomainContext>
> > <riaControls:DomainDataSource.FilterDescriptors>
> > <riaControls:FilterDescriptor
> > PropertyPath="AlbumId"
> > Operator="IsEqualTo"
> > IgnoredValue=""
> > Value="{Binding ElementName=albumDataGrid,
> > Path=SelectedItem.AlbumId, Mode=TwoWay}" >
> > </riaControls:FilterDescriptor>
> > </riaControls:DomainDataSource.FilterDescriptors>
> > </riaControls:DomainDataSource>
> > <sdk:DataGrid AutoGenerateColumns="False" Height="200"
> > ItemsSource="{Binding ElementName=trackDomainDataSource, Path=Data}"
> > Name="trackDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected"
> > Width="400">
> > <sdk:DataGrid.Columns>
> > <sdk:DataGridTextColumn x:Name="albumIdColumn1"
> > Binding="{Binding Path=AlbumId}" Header="Album Id" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="bytesColumn"
> > Binding="{Binding Path=Bytes}" Header="Bytes" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="composerColumn"
> > Binding="{Binding Path=Composer}" Header="Composer" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="genreIdColumn"
> > Binding="{Binding Path=GenreId}" Header="Genre Id" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="mediaTypeIdColumn"
> > Binding="{Binding Path=MediaTypeId}" Header="Media Type Id"
> > Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="millisecondsColumn"
> > Binding="{Binding Path=Milliseconds}" Header="Milliseconds"
> > Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="nameColumn"
> > Binding="{Binding Path=Name}" Header="Name" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="trackIdColumn"
> > Binding="{Binding Path=TrackId}" Header="Track Id" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="unitPriceColumn"
> > Binding="{Binding Path=UnitPrice}" Header="Unit Price" Width="SizeToHeader" />
> > </sdk:DataGrid.Columns>
> > </sdk:DataGrid>
> > </StackPanel>
> >
> > </ScrollViewer>
> > </Grid>
> >
> > </navigation:Page>
> >
From: Gerhard on
Hi,

Did you receive the solution file I sent to you?

Were you able to duplicate the issue?

Thanks.

Have a happy day!

"Allen Chen-MSFT" wrote:

> Hi Gerhard,
>
> Could you please send me your project for me to reproduce this issue?
> (including DB file, remove sensitive information) Please send the project to
> allenc at microsoft.com and keep the project as simple as possible.
>
> Regards,
> Allen Chen
> Microsoft Online Support
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg(a)microsoft.com.
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
>
> Note: MSDN Managed Newsgroup support offering is for non-urgent issues where
> an initial response from the community or a Microsoft Support Engineer within
> 2 business day is acceptable. Please note that each follow up response may
> take approximately 2 business days as the support professional working with
> you may need further investigation to reach the most efficient resolution.
> The offering is not appropriate for situations that require urgent, real-time
> or phone-based interactions. Issues of this nature are best handled working
> with a dedicated Microsoft Support Engineer by contacting Microsoft Customer
> Support Services (CSS) at
> http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Gerhard" wrote:
>
> > I am posting this again at request of Microsoft concierge.
> >
> > I have downloaded and installed both VS2010 RC and Silverlight 4 RC. In
> > testing out functionality, I built a simple RIA Business Application against
> > the Chinook database. I have a datagrid with the albums, another datagrid
> > with the tracks that ties to the selected album, and a combobox that ties to
> > the selected album's artist. When I do my first filter (using the built in
> > filter text box), all works fine, but if I change the filter, the combobox no
> > longer stays in sync (the datagrid does though). Can you please help? XAML
> > is as follows:
> >
> > <navigation:Page
> > x:Class="Chinook.Home"
> > xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
> > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
> > xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
> > xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
> >
> > xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
> > mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
> > Style="{StaticResource PageStyle}"
> >
> > xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
> > xmlns:my="clr-namespace:Chinook.Web.Services"
> > xmlns:my1="clr-namespace:Chinook.Web.Models"
> > xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
> > DataContext="{Binding}">
> > <sdk:Page.Resources>
> > <CollectionViewSource x:Key="albumTracksViewSource" Source="{Binding
> > Path=Data.Tracks, ElementName=albumDomainDataSource1}" />
> > </sdk:Page.Resources>
> > <Grid x:Name="LayoutRoot">
> > <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource
> > PageScrollViewerStyle}" Margin="-58,0,-58,-10">
> >
> > <StackPanel x:Name="ContentStackPanel" Style="{StaticResource
> > ContentStackPanelStyle}">
> >
> > <TextBlock x:Name="HeaderText" Style="{StaticResource
> > HeaderTextStyle}"
> > Text="{Binding
> > Path=ApplicationStrings.HomePageTitle, Source={StaticResource
> > ResourceWrapper}}"/>
> > <TextBlock x:Name="ContentText" Style="{StaticResource
> > ContentTextStyle}"
> > Text="Home page content"/>
> > <riaControls:DomainDataSource
> > AutoLoad="True"
> > d:DesignData="{d:DesignInstance my1:Artist,
> > CreateList=true}"
> > Height="0" LoadedData="artistDomainDataSource_LoadedData"
> > Name="artistDomainDataSource"
> > QueryName="GetArtistsQuery"
> > Width="0">
> > <riaControls:DomainDataSource.DomainContext>
> > <my:ChinookContext />
> > </riaControls:DomainDataSource.DomainContext>
> > </riaControls:DomainDataSource>
> > <ComboBox Height="27"
> > Name="comboBox1"
> > Width="398"
> > ItemsSource="{Binding}"
> > DataContext="{Binding
> > ElementName=artistDomainDataSource, Path=Data}"
> > DisplayMemberPath="Name"
> > SelectedValuePath="ArtistId"
> > SelectedValue="{Binding ElementName=albumDataGrid,
> > Path=SelectedItem.ArtistId, Mode=TwoWay}" />
> > <riaControls:DomainDataSource
> > AutoLoad="False"
> > d:DesignData="{d:DesignInstance my1:Album,
> > CreateList=true}"
> > Height="0"
> > LoadedData="albumDomainDataSource_LoadedData"
> > Name="albumDomainDataSource"
> > QueryName="GetAlbumsByStartQuery"
> > Width="0">
> > <riaControls:DomainDataSource.DomainContext>
> > <my:ChinookContext />
> > </riaControls:DomainDataSource.DomainContext>
> > <riaControls:DomainDataSource.QueryParameters>
> > <riaControls:Parameter ParameterName="startString"
> > Value="{Binding ElementName=startStringTextBox, Path=Text}" />
> > </riaControls:DomainDataSource.QueryParameters>
> > </riaControls:DomainDataSource>
> > <StackPanel Height="30" Orientation="Horizontal">
> > <sdk:Label Content="Start String:" Margin="3"
> > VerticalAlignment="Center" />
> > <TextBox Name="startStringTextBox" Width="60" />
> > <Button Command="{Binding Path=LoadCommand,
> > ElementName=albumDomainDataSource}" Content="Load" Margin="3"
> > Name="albumDomainDataSourceLoadButton"
> > Click="albumDomainDataSourceLoadButton_Click" />
> > </StackPanel>
> > <sdk:DataGrid AutoGenerateColumns="False" Height="200"
> > ItemsSource="{Binding ElementName=albumDomainDataSource, Path=Data}"
> > Name="albumDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected"
> > Width="400">
> > <sdk:DataGrid.Columns>
> > <sdk:DataGridTextColumn x:Name="albumIdColumn"
> > Binding="{Binding Path=AlbumId}" Header="Album Id" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="artistIdColumn"
> > Binding="{Binding Path=ArtistId}" Header="Artist Id" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="titleColumn"
> > Binding="{Binding Path=Title}" Header="Title" Width="SizeToHeader" />
> > </sdk:DataGrid.Columns>
> > </sdk:DataGrid>
> > <riaControls:DomainDataSource
> > AutoLoad="True"
> > d:DesignData="{d:DesignInstance my1:Track,
> > CreateList=true}"
> > Height="0"
> > LoadedData="trackDomainDataSource_LoadedData"
> > Name="trackDomainDataSource"
> > QueryName="GetTracksQuery"
> > Width="0">
> > <riaControls:DomainDataSource.DomainContext>
> > <my:ChinookContext />
> > </riaControls:DomainDataSource.DomainContext>
> > <riaControls:DomainDataSource.FilterDescriptors>
> > <riaControls:FilterDescriptor
> > PropertyPath="AlbumId"
> > Operator="IsEqualTo"
> > IgnoredValue=""
> > Value="{Binding ElementName=albumDataGrid,
> > Path=SelectedItem.AlbumId, Mode=TwoWay}" >
> > </riaControls:FilterDescriptor>
> > </riaControls:DomainDataSource.FilterDescriptors>
> > </riaControls:DomainDataSource>
> > <sdk:DataGrid AutoGenerateColumns="False" Height="200"
> > ItemsSource="{Binding ElementName=trackDomainDataSource, Path=Data}"
> > Name="trackDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected"
> > Width="400">
> > <sdk:DataGrid.Columns>
> > <sdk:DataGridTextColumn x:Name="albumIdColumn1"
> > Binding="{Binding Path=AlbumId}" Header="Album Id" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="bytesColumn"
> > Binding="{Binding Path=Bytes}" Header="Bytes" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="composerColumn"
> > Binding="{Binding Path=Composer}" Header="Composer" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="genreIdColumn"
> > Binding="{Binding Path=GenreId}" Header="Genre Id" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="mediaTypeIdColumn"
> > Binding="{Binding Path=MediaTypeId}" Header="Media Type Id"
> > Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="millisecondsColumn"
> > Binding="{Binding Path=Milliseconds}" Header="Milliseconds"
> > Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="nameColumn"
> > Binding="{Binding Path=Name}" Header="Name" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="trackIdColumn"
> > Binding="{Binding Path=TrackId}" Header="Track Id" Width="SizeToHeader" />
> > <sdk:DataGridTextColumn x:Name="unitPriceColumn"
> > Binding="{Binding Path=UnitPrice}" Header="Unit Price" Width="SizeToHeader" />
> > </sdk:DataGrid.Columns>
> > </sdk:DataGrid>
> > </StackPanel>
> >
> > </ScrollViewer>
> > </Grid>
> >
> > </navigation:Page>
> >
From: Allen Chen [MSFT] on
Hi Gerhard,

>Hi,

>Did you receive the solution file I sent to you?

>Were you able to duplicate the issue?

>Thanks.

>Have a happy day!

Yes thanks for the project. I could reproduce this issue and had worked for
several hours to get it finally working.

As to the scrolling issue, this is a known issue that if the items in
ComboBox have different width we cannot scroll

up or down properly.

Workaround is to give the VirtualizingStackPanel or StackPanel a fixed
width. I don't recommend you use

VirtualizingStackPanel currently in ComboBox because there're other known
issues regarding VirtualizingStackPanel

+ComboBox:


<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Width="300" />
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>

To avoid potential CanLoad issue of DomainDataSource, please add the
following code to your TextBox:

<TextBox IsEnabled="{Binding
ElementName=albumDomainDataSource, Path=CanLoad}" Name="startStringTextBox"
Width="60" />

And add the following event handler for ComboBox. (I found somehow the
second binding breaks the two way binding of ComboBox so I manually "bind"
data in this event handler to work around)

private void artistComboBox_SelectionChanged(object sender,
SelectionChangedEventArgs e)
{
var album=albumDataGrid.SelectedItem as Album;
if (album != null)
{
album.ArtistId =
((Artist)artistComboBox.SelectedItem).ArtistId;
}
albumDomainDataSource.SubmitChanges();
}

<ComboBox Height="23"
ItemsSource="{Binding
ElementName=artistDomainDataSource, Path=Data}"
DisplayMemberPath="Name"
SelectionChanged="artistComboBox_SelectionChanged"
SelectedValuePath="ArtistId"
SelectedValue="{Binding
ElementName=albumDataGrid, Path=SelectedItem.ArtistId, Mode=TwoWay}"
Name="artistComboBox"
Width="120">
....

After all above steps your project works fine at my side. Please test and
let me know whether it works for you. If you have additional questions
please feel free to ask. I'll do my best to follow up.

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg(a)microsoft.com.

From: Gerhard on
Thanks for all your work.

The scroll part it working fine.

However, I still don't see that the binding between the two is working.
When I put 'ba' into the start string, all is working fine. When I change
the 'ba' to 'bach' and load, the combobox does not select the correct artist.

Also, if I take out the submitchanges from the code behind, the start string
and load button stay disabled. I'm not always going to want a save to be
automatic on any change in a combo box selection.

Are the development folks working to get the combo box working as expected
before they release the product?

One other question, how do I get the Load button to fire when hit enter
after putting in a start string?

Thanks again for all you work on this.

"Allen Chen [MSFT]" wrote:

> Hi Gerhard,
>
> >Hi,
>
> >Did you receive the solution file I sent to you?
>
> >Were you able to duplicate the issue?
>
> >Thanks.
>
> >Have a happy day!
>
> Yes thanks for the project. I could reproduce this issue and had worked for
> several hours to get it finally working.
>
> As to the scrolling issue, this is a known issue that if the items in
> ComboBox have different width we cannot scroll
>
> up or down properly.
>
> Workaround is to give the VirtualizingStackPanel or StackPanel a fixed
> width. I don't recommend you use
>
> VirtualizingStackPanel currently in ComboBox because there're other known
> issues regarding VirtualizingStackPanel
>
> +ComboBox:
>
>
> <ComboBox.ItemsPanel>
> <ItemsPanelTemplate>
> <StackPanel Width="300" />
> </ItemsPanelTemplate>
> </ComboBox.ItemsPanel>
>
> To avoid potential CanLoad issue of DomainDataSource, please add the
> following code to your TextBox:
>
> <TextBox IsEnabled="{Binding
> ElementName=albumDomainDataSource, Path=CanLoad}" Name="startStringTextBox"
> Width="60" />
>
> And add the following event handler for ComboBox. (I found somehow the
> second binding breaks the two way binding of ComboBox so I manually "bind"
> data in this event handler to work around)
>
> private void artistComboBox_SelectionChanged(object sender,
> SelectionChangedEventArgs e)
> {
> var album=albumDataGrid.SelectedItem as Album;
> if (album != null)
> {
> album.ArtistId =
> ((Artist)artistComboBox.SelectedItem).ArtistId;
> }
> albumDomainDataSource.SubmitChanges();
> }
>
> <ComboBox Height="23"
> ItemsSource="{Binding
> ElementName=artistDomainDataSource, Path=Data}"
> DisplayMemberPath="Name"
> SelectionChanged="artistComboBox_SelectionChanged"
> SelectedValuePath="ArtistId"
> SelectedValue="{Binding
> ElementName=albumDataGrid, Path=SelectedItem.ArtistId, Mode=TwoWay}"
> Name="artistComboBox"
> Width="120">
> ....
>
> After all above steps your project works fine at my side. Please test and
> let me know whether it works for you. If you have additional questions
> please feel free to ask. I'll do my best to follow up.
>
> Regards,
> Allen Chen
> Microsoft Online Support
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg(a)microsoft.com.
>
> .
>