0
셀 편집 템플릿의 DataGrid 안에 텍스트 상자가 있습니다. 텍스트 상자에 입력 된 텍스트 을 각 셀의 텍스트 블록에 바인딩하고 싶습니다. 이 코드를 시도했지만 작동하지 않습니다.DataGrid 내에서 texbox에 입력 된 텍스트를 검색하는 방법
여기 내 XAML입니다 :
<DataTemplate>
<StackPanel Orientation="Horizontal">
<!--<ComboBox x:Name="monday" Width="50" IsSynchronizedWithCurrentItem="true" Loaded="monday_Loaded" SelectionChanged="monday_SelectionChanged"></ComboBox>-->
<ComboBox x:Name="monday" Width="30" ItemsSource="{Binding Path=Subjects}" DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" SelectedItem="{Binding SelectedCollectionItem,Mode=TwoWay}" Loaded="monday_Loaded" SelectionChanged="monday_SelectionChanged"></ComboBox>
<ComboBox x:Name="staff" Width="30" ItemsSource="{Binding Path=mondstaff}" DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" SelectedItem="{Binding SelectedCollectionItem1,Mode=TwoWay}" Loaded="staff_Loaded" SelectionChanged="staff_SelectionChanged"></ComboBox>
<TextBox x:Name="monothers" Visibility="Hidden" Text="{Binding Path=Subjects}" DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" SelectedText ="{Binding SelectedCollectionItem2,Mode=TwoWay}" Width="30" TextChanged="monothers_TextChanged"></TextBox>
<!--<ComboBox x:Name="staff" Width="50" Loaded="staff_Loaded"></ComboBox>-->
</StackPanel>
</DataTemplate>
여기 내 코드입니다 :
public string SelectedCollectionItem
{
get { return _SelectedCollectionItem; }
set
{
_SelectedCollectionItem = value;
RaiseProperty2("SelectedCollectionItem2");
}
}
사람이 그것을 수행하는 방법을 알고있는 경우
은, 친절하게 도와주세요.
의견을 보내 주셔서 감사합니다. – prabhakar