从datagrid中的一行中的选定单元格中删除边框 [英] Remove the border from a selected cell in a row in datagrid

查看:121
本文介绍了从datagrid中的一行中的选定单元格中删除边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以在Jesse Furher周围的图片中看到黑色边框线,如何删除所有单元格的边框线?

< img src =''http://www.picz.ro/thumbnails/e74aed009a3f8c741e40db819509a77e.png'' alt =图像托管" border ="0''>

As you can see in the picture around Jesse Furher has a black border line, how can i remove that line for all cells?

<img src=''http://www.picz.ro/thumbnails/e74aed009a3f8c741e40db819509a77e.png'' alt=''Image Hosting'' border=''0''>

<DataGrid SelectionUnit="FullRow" SelectionMode="Extended"  ItemsSource="{Binding Path=DataClienti}" AutoGenerateColumns="False" Height="257" Margin="11,34,114,0" Name="dataGrid1" VerticalAlignment="Top" DataContext="{Binding}" IsSynchronizedWithCurrentItem="True" GridLinesVisibility="Horizontal">

                    <DataGrid.Columns>
                        <DataGridTextColumn Width="60" IsReadOnly="True"  Header="Nr. crt" Binding="{Binding Id}" SortDirection="Descending"></DataGridTextColumn>
                        <DataGridTextColumn Width="0.3*" IsReadOnly="True" Header="Nume Client" Binding="{Binding NumeClient}"></DataGridTextColumn>
                        <DataGridTextColumn Width="0.3*" IsReadOnly="True" Header="Tip Utilaj" Binding="{Binding TipUtilaj}"></DataGridTextColumn>
                        <DataGridTextColumn Width="0.3*" IsReadOnly="True" Header="Telefon" Binding="{Binding Telefon}"></DataGridTextColumn>
                        <DataGridTextColumn Width="0.3*" IsReadOnly="True" Header="Mecanic" Binding="{Binding Mecanic}"></DataGridTextColumn>
                        <DataGridTextColumn Width="0.2*" IsReadOnly="True" Header="Cost" Binding="{Binding Cost}"></DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>

推荐答案

您可以查看以下属性:

http://blogs.msdn.com/b/jaimer/archive/2009/01/20/styling-microsoft-s-wpf-datagrid.aspx [ http://social.msdn.microsoft.com/Forums/zh/wpf/thread/8e6f3c70-f65f-4152-9469-9ae3e9239126 [ http://msdn.microsoft.com/en-us/library/cc278066 (v = VS.95).aspx [
You could take a look at these properties:

http://blogs.msdn.com/b/jaimer/archive/2009/01/20/styling-microsoft-s-wpf-datagrid.aspx[^]

if that doesn''t work, you would have to modify the default template for the DataGrid, but it''s rather advanced..

http://social.msdn.microsoft.com/Forums/en/wpf/thread/8e6f3c70-f65f-4152-9469-9ae3e9239126[^]

http://msdn.microsoft.com/en-us/library/cc278066(v=VS.95).aspx[^]


<datagrid.cellstyle>

                       <style targettype="DataGridCell">

                           <style.triggers>

                               <trigger property="IsSelected" value="True">

                                   <setter property="BorderThickness" value="0" />

                               </trigger>

                           </style.triggers>

                       </style>
 </datagrid.cellstyle>



在看到示例之后,我意识到我可以在属性上创建一个setter,这解决了我的GUI问题



after i saw the examples i realized that i can create a setter on the property isselected and this solved my GUI problem


这篇关于从datagrid中的一行中的选定单元格中删除边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆