WPF using a ComboBox as a record selector

B

Bill McCormick

Hello,

I have a ComboBox on a Grid:

<ComboBox Name="cmbItemId"
ItemsSource="{Binding}"
DisplayMemberPath="ItemId"
SelectedValuePath="ItemId"/>

The DataContext of the Grid is:

var items = from it in _db.Items
select it;
ItemGrid.DataContext = items.ToList();

So the ComboBox just diplays a list of ItemId's; nothin' fancy.

No, I've got a TextBox that I want to display/edit the selected Item
description:

<TextBox Grid.Column="3"
Grid.Row="0"
Text="{Binding ?????}"/>

What should the binding be set to? Is this possible to do binding
LinqToSql?


Thanks,

Bill
 
B

Bill McCormick

Bill said:
Hello,

I have a ComboBox on a Grid:

<ComboBox Name="cmbItemId"
ItemsSource="{Binding}"
DisplayMemberPath="ItemId"
SelectedValuePath="ItemId"/>

The DataContext of the Grid is:

var items = from it in _db.Items
select it;
ItemGrid.DataContext = items.ToList();

So the ComboBox just diplays a list of ItemId's; nothin' fancy.

No, I've got a TextBox that I want to display/edit the selected Item
description:

<TextBox Grid.Column="3"
Grid.Row="0"
Text="{Binding ?????}"/>

What should the binding be set to? Is this possible to do binding
LinqToSql?
I figured this one out by myself too.
 
B

Bill McCormick

Bill said:
Hello,

I have a ComboBox on a Grid:

<ComboBox Name="cmbItemId"
ItemsSource="{Binding}"
DisplayMemberPath="ItemId"
SelectedValuePath="ItemId"/>

The DataContext of the Grid is:

var items = from it in _db.Items
select it;
ItemGrid.DataContext = items.ToList();

So the ComboBox just diplays a list of ItemId's; nothin' fancy.

No, I've got a TextBox that I want to display/edit the selected Item
description:

<TextBox Grid.Column="3"
Grid.Row="0"
Text="{Binding ?????}"/>

What should the binding be set to? Is this possible to do binding
LinqToSql?
I figured this one out by myself too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top