After spending it, following on the heels of my Last problem , I begin to feel that Framework 4 is a master of subtle evil, or my PC is haunting.
I have three comboboxes and a text box in the form of WPF, and I have a ready-made Subsonic 3 ActiveRecord DAL. When I upload this edit entry form, the combo boxes are filled in correctly, they select the correct elements, and the text field has the correct text. I can change the text of the TextBox and save the record just fine, but the combo box CANNOT CHANGE. Lists drop out and stand out, but when you click on an item, the selected item remains the same.
Here is my xaml:
<StackPanel Orientation="Horizontal" Margin="10,10,0,0">
<TextBlock Width="80">Asset</TextBlock>
<ComboBox Name="cboAsset" Width="180"
DisplayMemberPath="AssetName"
SelectedValuePath="AssetID"
SelectedValue="{Binding AssetID}" ></ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="10,10,0,0">
<TextBlock Width="80">Status</TextBlock>
<ComboBox Name="cboStatus" Width="180"
DisplayMemberPath="JobStatusDesc" SelectedValuePath="JobStatusID"
SelectedValue="{Binding JobStatusID}" ></ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="10,10,0,0">
<TextBlock Width="80">Category</TextBlock>
<ComboBox Name="cboCategories" Width="180"
DisplayMemberPath="CategoryName"
SelectedValuePath="JobCategoryID"
SelectedValue="{Binding JobCategoryID}" ></ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="10,10,0,0">
<TextBlock Width="80">Reason</TextBlock>
<TextBox Name="txtReason" Width="380" Text="{Binding Reason}"/>
</StackPanel>
Here are the relevant links of my code (intJobID passed in):
SvcMgrDAL.Job oJob;
IQueryable<SvcMgrDAL.JobCategory> oCategories = SvcMgrDAL.JobCategory.All().OrderBy(x => x.CategoryName);
IQueryable<SvcMgrDAL.Asset> oAssets = SvcMgrDAL.Asset.All().OrderBy(x => x.AssetName);
IQueryable<SvcMgrDAL.JobStatus> oStatus = SvcMgrDAL.JobStatus.All();
cboCategories.ItemsSource = oCategories;
cboStatus.ItemsSource = oStatus;
cboAsset.ItemsSource = oAssets;
this.JobID = intJobID;
oJob = SvcMgrDAL.Job.SingleOrDefault(x => x.JobID == intJobID);
this.DataContext = oJob;
Things I tried:
IsReadOnly="false" IsSynchronizedWithCurrentItem="True"ItemSources IQueryables Lists.- Job ( vanilla
INotifyPropertyChanged). - .
ItemsSource="{Binding}"
Subsonic DAL INotifyPropertyChanged, , , . - .
( ), , - . , ?
: - AssetID . WPF WTF:)
2: - (.. displaymemberpath, treemememberpath itemssouce), STILL ! .