Hello, i'm studying the mvvm pattern with c#. I've a problem!
I have a datagrid with an ItemSource (class "Order") and a SelectedItem ("SelectedOrder").
With a select i fill a form with the information conteined in the datagrid, but for some values i need to proposing some choice with combobox.
The choices of the combobox are not in the selecteditem.
How can I display the detail of my selected article of data and give the possibility to the user to choice from a list of value (OPEN, CLOSE, ...).
Thanks in advance
What I have tried:
This is the view
<pre>
<Grid DataContext="{Binding SelectedOrder}">
...
<Label Content="Customer:" FontSize="12" x:Name="lblState" VerticalAlignment="Top" Grid.Row="2" Grid.Column="2"/>
<ComboBox x:Name="cmbState" FontSize="12" FontWeight="Normal" IsEditable="True" Grid.Row="2" Grid.Column="3" Text="{Binding state,Mode=TwoWay}">
...
</Grid>
<DataGrid ItemsSource="{Binding Order, IsAsync=True}" SelectedItem="{Binding SelectedOrder, Mode=TwoWay}" Grid.Row="3" AutoGenerateColumns="false" CanUserAddRows="False" CanUserSortColumns="True" CanUserResizeRows="False" IsReadOnly="True" SelectionMode="Single" SelectionUnit="FullRow">
<DataGrid.Columns>
<DataGridTextColumn Header="Number" Binding="{Binding numOrder}" Width="1*" />
This is the class Order
public class Order
{
public int id { get; set; }
public string numOrder { get; set; }
public string title { get; set; }
public string state { get; set; }
public string dateCreation { get; set; }
public string note { get; set; }
}