Datagrid列定义silverlight问题
在XAML中:
错误 1 类型“DataGridTextColumn” 不支持直接
我想在datagridview的列的每一行添加一个按钮 在数据网格中
查看:
<UserControl x:Class="Paradigma.Silverlight.DiccionarioDatos.UserControlAdminEmpleados"
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:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
xmlns:ig="http://schemas.infragistics.com/xaml"
mc:Ignorable="d"
d:DesignHeight="469" d:DesignWidth="641" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
<Grid x:Name="LayoutRoot" Background="White">
<ListBox Height="145" HorizontalAlignment="Left" Margin="12,32,0,0" Name="lbEmpleado" VerticalAlignment="Top" Width="267" />
<ListBox Height="145" HorizontalAlignment="Right" Margin="0,32,100,0" Name="lbRoles" VerticalAlignment="Top" Width="256" />
<Button Content="Agregar" Margin="0,32,11,0" Name="butAgregar" Click="butAgregar_Click" HorizontalAlignment="Right" Width="83" Height="145" VerticalAlignment="Top" />
<sdk:DataGrid AutoGenerateColumns="False" Height="230" Margin="11,0,11,47" Name="dgRelaciones" VerticalAlignment="Bottom">
<sdk:DataGrid.Columns>
<sdk:DataGridTextColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Empleado" IsReadOnly="False" Width="Auto" Binding="{Binding Empleado.Nombre}"/>
<sdk:DataGridTextColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Rol" IsReadOnly="False" Width="Auto" Binding="{Binding Rol.Nombre}"/>
<sdk:DataGridTextColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Acciones" IsReadOnly="False" Width="Auto" >
<StackPanel />
</sdk:DataGridTextColumn>
</sdk:DataGrid.Columns>
</sdk:DataGrid>
</Grid>
</UserControl>
in xaml :
Error 1 The type 'DataGridTextColumn'
does not support direct
I want to add a button in each row in a column in a datagridview
in a datagrid
Look:
<UserControl x:Class="Paradigma.Silverlight.DiccionarioDatos.UserControlAdminEmpleados"
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:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
xmlns:ig="http://schemas.infragistics.com/xaml"
mc:Ignorable="d"
d:DesignHeight="469" d:DesignWidth="641" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
<Grid x:Name="LayoutRoot" Background="White">
<ListBox Height="145" HorizontalAlignment="Left" Margin="12,32,0,0" Name="lbEmpleado" VerticalAlignment="Top" Width="267" />
<ListBox Height="145" HorizontalAlignment="Right" Margin="0,32,100,0" Name="lbRoles" VerticalAlignment="Top" Width="256" />
<Button Content="Agregar" Margin="0,32,11,0" Name="butAgregar" Click="butAgregar_Click" HorizontalAlignment="Right" Width="83" Height="145" VerticalAlignment="Top" />
<sdk:DataGrid AutoGenerateColumns="False" Height="230" Margin="11,0,11,47" Name="dgRelaciones" VerticalAlignment="Bottom">
<sdk:DataGrid.Columns>
<sdk:DataGridTextColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Empleado" IsReadOnly="False" Width="Auto" Binding="{Binding Empleado.Nombre}"/>
<sdk:DataGridTextColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Rol" IsReadOnly="False" Width="Auto" Binding="{Binding Rol.Nombre}"/>
<sdk:DataGridTextColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Acciones" IsReadOnly="False" Width="Auto" >
<StackPanel />
</sdk:DataGridTextColumn>
</sdk:DataGrid.Columns>
</sdk:DataGrid>
</Grid>
</UserControl>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用的是 sdk:DataGridTextColumn,而不是 sdk:DataGridTemplateColumn :S
它可以工作
I was using the sdk:DataGridTextColumn, not the sdk:DataGridTemplateColumn :S
it works