J'ai Fenêtre. Window.DataContext = DataRow.Comment lier un DataRow à un TextBlock?
et j'ai TextBlock.
J'ai besoin de lier DataRow.Array [0] à la propriété Text d'un TextBlock.
Comment puis-je le faire?
edit:
<Window x:Class="Client.payment.CheckMore"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpf="http://schemas.microsoft.com/wpf/2008/toolkit" Loaded="Window_Loaded" x:Name="p_this">
<DockPanel>
<TextBlock x:Name="p_idCheck" Text="{Binding Path=Array[0]}"/>
</DockPanel>
</Window>
en code: this.DataContext = dateRow.Rows [0];
Est-ce que tout autre travail de liaison ?? Je veux dire que vous définissez datacontext après que le contrôle a été créé et, je suppose, rendu. essayer de le faire avant ou augmenter l'événement canexecutechanged .. –
je ne pas undastanet vous – Mediator