wpf datagrid到wpf datagrid值显示

时间:2014-05-05 12:27:44

标签: c# wpf

我是wpf c#中的新手,我想知道当我们在datagrid1中选择一行时如何显示,那些值传递给另一个表单的另一个数据网格,请帮我解决。 当我点击一个数据网格行意味着它想要在下一个窗口的数据网格中显示一个进度条和一个按钮 请帮我解决这个问题。

        <DataGrid.RowStyle>
            <Style TargetType="DataGridRow">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Gender}" Value="M">
                        <Setter Property="Background" Value="Yellow"></Setter>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding Gender}" Value="F">
                        <Setter Property="Background" Value="Lime"></Setter>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </DataGrid.RowStyle>
        <DataGrid.Columns>
            <DataGridTextColumn Binding="{Binding Path=Patient ID}" Header="Patient ID" Width="120" />
            <DataGridTextColumn Binding="{Binding Path=Patient Name}" Header="Patient Name" Width="150" />
            <DataGridTextColumn Binding="{Binding Path=Gender}" Header="Gender" Width="100" />
            <DataGridTextColumn Binding="{Binding Path=Study Date Time}" Header="Study Date &amp;Time" Width="150" />
            <DataGridTextColumn Binding="{Binding Path=Modality}" Header="Modality" Width="150" />
            <DataGridTextColumn Binding="{Binding Path=Study Name}" Header="Study Name" Width="150" />
            <DataGridTextColumn Binding="{Binding Path=Ref Physicion}" Header="Ref Physician" Width="150" />
            <DataGridTextColumn Binding="{Binding Path=Instances}" Header="Instances" Width="150" />
            <DataGridTextColumn Binding="{Binding Path=Clinical History}" Header="Clinical History" Width="150" />
            <DataGridTextColumn Binding="{Binding Path=Status}" Header="Status" Width="100" />
        </DataGrid.Columns>
        <!--<DataGrid Name="fo" ItemsSource="{Binding}" SelectedItem="key" Grid.Row="1">-->
            <DataGrid.ContextMenu>
                <ContextMenu x:Name="CMenu">
                    <MenuItem Name="Send" Header="Send" Click="Send_Click"/>
                    <MenuItem Name="check" Header="Check Report in Server"/>
                    <MenuItem Name="Delete" Header="Delete"/>
                    </ContextMenu>
            </DataGrid.ContextMenu>
        <!--</DataGrid>-->
    </DataGrid>
    <Canvas Height="30" Name="canvas4" Margin="1,549,-1,150">
        <Label Canvas.Left="14" Canvas.Top="0" Content="SeriesDetails:" Height="28" Name="label4" FontFamily="Vijaya" FontSize="20" FontWeight="Bold" />
    </Canvas>
    <Canvas Name="canvas5" Margin="0,698,-1,0">
        <Label Canvas.Left="6" Canvas.Top="1" Content="Welcome Team" Height="28" Name="label5" FontFamily="Vijaya" FontWeight="Bold" FontSize="24" />
        <Label Content="Optics Image Server" Height="28" Name="label6" Canvas.Left="1153" Canvas.Top="1" FontFamily="Vijaya" FontWeight="Bold" FontSize="20" Width="164" />
        <ProgressBar Canvas.Left="145" Canvas.Top="6" Height="19" Name="progressBar1" Width="133" Visibility="Visible" />
    </Canvas>
    <DataGrid AutoGenerateColumns="False" Name="dataGrid2" Width="1344" Margin="2,579,-2,31">
        <DataGrid.Columns>
            <DataGridTextColumn Header="Series No" Width="450" />
            <DataGridTextColumn Header="Series Description" Width="450" />
            <DataGridTextColumn Header="Ins" Width="250" />
        </DataGrid.Columns>
    </DataGrid>

0 个答案:

没有答案