我如何可以將屬性Name
或x:Name
添加到這個XAML代碼(組合框):活動添加到XAML
<DataGridTemplateColumn Header="Status">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock VerticalAlignment="Center" Text="{Binding name_ru}" Width="Auto" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox Style="{DynamicResource ComboBoxStyle}" SelectionChanged="status_SelectionChanged" Height="auto" Width="Auto">
<ComboBox.BorderBrush>
<SolidColorBrush Color="{DynamicResource Color1}"/>
</ComboBox.BorderBrush>
</ComboBox>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
以及如何添加事件Click
或其他在此XAML代碼:
<!--Clien-->
<DataGridTemplateColumn Header="Client name" HeaderStyle="{DynamicResource DataGridColumnHeaderStyle1}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock VerticalAlignment="Center" Text="{Binding user_name}" Width="Auto" Height="Auto" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--end Clien-->
我的頂尖xaml:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:ee="http://schemas.microsoft.com/expression/2010/effects"
xmlns:System="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
x:Class="JanPizza.IndexFormPizza"
x:Name="MainWnd"
Title="MainWindow"
MouseLeftButtonDown="MainWnd_MouseLeftButtonDown"
ResizeMode="CanResizeWithGrip"
xmlns:wpftoolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
xmlns:filter="clr-namespace:DataGridFilterLibrary;assembly=DataGridFilterLibrary"
Width="1065" Height="674" Background="{x:Null}" BorderThickness="0" Margin="5" WindowStartupLocation="CenterScreen" Foreground="#FF2D2D2D" Icon="wnd-icon.png" Style="{DynamicResource WindowStyle}" AllowsTransparency="True" WindowStyle="None" AllowDrop="False">
這是什麼問題? '<組合框名稱=「狀態」....' – harry180 2012-07-11 07:41:11
代碼 – kekus 2012-07-11 07:42:53
不可行你試過了什麼? – harry180 2012-07-11 07:43:43