Click here to Skip to main content
15,909,503 members
Home / Discussions / WPF
   

WPF

 
QuestionDrawing with custom Pen Pin
pym4-Dec-08 2:54
pym4-Dec-08 2:54 
AnswerRe: Drawing with custom Pen Pin
Mohammad Dayyan5-Dec-08 1:28
Mohammad Dayyan5-Dec-08 1:28 
QuestionReport definition file can't be opened Pin
Arijit Manna4-Dec-08 1:29
Arijit Manna4-Dec-08 1:29 
GeneralRe: Report definition file can't be opened Pin
Pete O'Hanlon4-Dec-08 2:04
mvePete O'Hanlon4-Dec-08 2:04 
GeneralRe: Report definition file can't be opened Pin
Arijit Manna5-Dec-08 19:40
Arijit Manna5-Dec-08 19:40 
QuestionDesigning WPF application in VS-2008 Pin
NeCroFire4-Dec-08 0:03
NeCroFire4-Dec-08 0:03 
AnswerRe: Designing WPF application in VS-2008 Pin
Mark Salsbery4-Dec-08 6:17
Mark Salsbery4-Dec-08 6:17 
QuestionLinq To SQL & WPF Cascading Comboboxes Pin
Member 44002433-Dec-08 7:36
Member 44002433-Dec-08 7:36 
Hello everyone!

I'll try to explain my trouble.

First, I have a LINQ To SQL class with two tables: Talleres and Areas. First table (Talleres) has a field called Area which contains an id of the Areas table, so there's the realtion Talleres.Area --> Area.Id defined at the database and, by extension, at the LINQ to SQL class.

Now, I want to make a form in WPF that presents two comboboxes. In combobox one (TalleresComboBox) there should show the list of Talleres (showing their property Name) and in combobox two (AreasComboBox) there should show the list of Areas (also showing their own property Name). There's also a SubmitButton to submit changes.

The behaviour of this form is very simple buy I can't be able to implement:

Point number 1. If we change the current element of TalleresComboBox, the element of AreasComboBox must autochange to the corresponding value.
Point number 2. We must be able to change the Area field of the Talleres element by changing the current item from AreasComboBox and updating database by pressing SubmitButton.

My code right now is the following:


C# Part

private void Window_Loaded(object sender, RoutedEventArgs e)
{
var Talleres = from row in dc.Talleres_talleres
select row;
TalleresComboBox.DataContext = Talleres;

var Areas = return from row in dc.Talleres_areas
select row;
AreasComboBox2.DataContext = Areas;
}


XAML Part

<Grid Height="354" Width="573">
<ComboBox ItemsSource="{Binding}"
DisplayMemberPath="name"
IsSynchronizedWithCurrentItem="True"
Margin="157,20,0,0" x:Name="TalleresComboBox" HorizontalAlignment="Left" VerticalAlignment="Top" Width="386" Height="23"/>

<ComboBox ItemsSource="{Binding}"
DisplayMemberPath="name"
SelectedValuePath="id"
SelectedValue="{Binding ElementName=TalleresComboBox, Path=SelectedItem.area, Mode=OneWay}"
Height="23" Margin="157,60,0,0" Name="comboBox2" VerticalAlignment="Top" HorizontalAlignment="Left" Width="386" />

<Button Height="23" HorizontalAlignment="Left" Margin="468,309,0,0" Name="button1" VerticalAlignment="Top" Width="75"
Click="button1_Click">Actualizar</Button>
</Grid>


I succedded in point number 1 but not point number 2. I've tried diferent things but no one has been ok.

Please help. Thanks very much.
QuestionLooking for this type of component in silverlight.... Pin
Goalie352-Dec-08 4:47
Goalie352-Dec-08 4:47 
AnswerRe: Looking for this type of component in silverlight.... Pin
Ge3ks22-Dec-08 3:50
Ge3ks22-Dec-08 3:50 
QuestionPlaying a *.MP3 file in WPF ? Pin
Mohammad Dayyan2-Dec-08 2:11
Mohammad Dayyan2-Dec-08 2:11 
AnswerRe: Playing a *.MP3 file in WPF ? Pin
Mark Salsbery2-Dec-08 6:28
Mark Salsbery2-Dec-08 6:28 
AnswerRe: Playing a *.MP3 file in WPF ? Pin
Paul Conrad2-Dec-08 6:59
professionalPaul Conrad2-Dec-08 6:59 
AnswerRe: Playing a *.MP3 file in WPF ? Pin
Pete O'Hanlon2-Dec-08 9:01
mvePete O'Hanlon2-Dec-08 9:01 
GeneralRe: Playing a *.MP3 file in WPF ? Pin
Jammer2-Dec-08 22:55
Jammer2-Dec-08 22:55 
GeneralRe: Playing a *.MP3 file in WPF ? Pin
Mohammad Dayyan3-Dec-08 8:18
Mohammad Dayyan3-Dec-08 8:18 
QuestionSending dll Pin
Dushan1232-Dec-08 1:57
Dushan1232-Dec-08 1:57 
AnswerRe: Sending dll Pin
Pete O'Hanlon2-Dec-08 3:40
mvePete O'Hanlon2-Dec-08 3:40 
GeneralRe: Sending dll Pin
Dushan1232-Dec-08 9:00
Dushan1232-Dec-08 9:00 
GeneralRe: Sending dll Pin
Pete O'Hanlon3-Dec-08 4:13
mvePete O'Hanlon3-Dec-08 4:13 
GeneralRe: Sending dll Pin
Dushan1233-Dec-08 16:26
Dushan1233-Dec-08 16:26 
GeneralRe: Sending dll Pin
Dushan1233-Dec-08 17:55
Dushan1233-Dec-08 17:55 
GeneralRe: Sending dll Pin
Pete O'Hanlon3-Dec-08 22:19
mvePete O'Hanlon3-Dec-08 22:19 
QuestionTimeSpan? Pin
Mohammad Dayyan2-Dec-08 1:35
Mohammad Dayyan2-Dec-08 1:35 
AnswerRe: TimeSpan? Pin
Pete O'Hanlon2-Dec-08 3:36
mvePete O'Hanlon2-Dec-08 3:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.