Reputation: 2501
What is the best solution to have something like a web_application DetaisView control(horizontal dataGrid with just one row!) with binding, insert and update features?
Upvotes: 1
Views: 2424
Reputation: 675
Create a user control that contains the specified fields you need to edit an item of your list
<UserControl x:Class="DisplayUserControl" ...>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Name"/>
<TextBox Text="{Binding Name}"/>
</StackPanel>
...
</UserControl>
Bind the user control datacontext to the selected item of your List
<MainWindow>
<ListBox ItemsSource="{Binding to your data}" x:Name="list"/>
<local:DisplayUserControl DataContext="{Binding SelectedItem, ElementName=list}"/>
</MainWindow>
I just used a simple ListBox for displaying data
Upvotes: 1