1
I have a Textbox where you get the customer id and I also have a Datagrid where he has some personal information. Well so far so good, what I’m not getting is to connect the two in the following way:
When I change the value of the Textbox (client id) by changing focus, it would have to change the Datagrid data according to the client selected in the Textbox
<TextBox Text="{Binding ElementName=dataGridTelefones,
Path=SelectedItem.id_empresa,
NotifyOnSourceUpdated=True}"
Name="textCodigo" />
<DataGrid AutoGenerateColumns="False" HorizontalAlignment="Left"
Margin="12,12,0,0" VerticalAlignment="Top"
ItemsSource="{Binding}" Name="dataGridTelefones" Height="100"
Canvas.Left="113" Canvas.Top="539"
Width="938" FontWeight="Normal" GridLinesVisibility="All"
IsReadOnly="True" IsSynchronizedWithCurrentItem="True">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Path=prefixo}"
Header="Prefixo" />
<DataGridTextColumn Binding="{Binding Path=telefone}"
Header="Telefone" />
<DataGridTextColumn Binding="{Binding Path=obs}"
Header="Observações" />
</DataGrid.Columns>
</DataGrid>
Could someone help me?