WPF:ListView数据绑定及Style
DrugRecordsWin.xaml
<ListView Grid.Row="4" Grid.Column="1" Name="list_DrugDetails" Style="{StaticResource ListViewStyle}">
<ListView.View>
<GridView>
<!--列头style-->
<GridView.ColumnHeaderContainerStyle>
<Style TargetType="GridViewColumnHeader">
<Setter Property="Background" Value="CadetBlue"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="25"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Padding" Value="5"/>
</Style>
</GridView.ColumnHeaderContainerStyle>
<!--列头数据及绑定-->
<GridViewColumn Header="药品Id" DisplayMemberBinding="{Binding Idm}"/>
<GridViewColumn Header="药品名称" DisplayMemberBinding="{Binding DrugName}"/>
<GridViewColumn Header="药品规格" DisplayMemberBinding="{Binding DrugSpec}"/>
<GridViewColumn Header="数量" DisplayMemberBinding="{Binding Quantity}"/>
<GridViewColumn Header="批次序号" DisplayMemberBinding="{Binding BatchXh}"/>
<GridViewColumn Header="批号" DisplayMemberBinding="{Binding BatchNo}"/>
</GridView>
</ListView.View>
</ListView>
DrugRecordsWin.xaml.cs
list_DrugDetails.ItemsSource=源
/// 双击list的某列时获取该列发要单的详细药品列表
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void list_BillDetails_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
var drugDetails = list_BillDetails.SelectedItem as WPF_OPDrug.DataOP.OutBillInfor;
int xh = drugDetails.Xh;
list_DrugDetails.ItemsSource = dataOP.GetOPDrugOutBillDataByBillXh(xh);
}
WPF:ListView数据绑定及Style的更多相关文章
- WPF ListView 选中问题
WPF ListView 选中问题 摘自:http://www.cnblogs.com/BBHor/archive/2013/04/28/VisualTreeHelper-PreviewMouseD ...
- Wpf ListView展示风格
ListView数据绑定控件,通常是竖列展示,也可以通过改变ListView的布局来改变它的展示方式 如图展示: 主要需用修改的样式如下: <!--GridView Header样式 去除Gri ...
- WPF ListView 居中显示
原文:WPF ListView 居中显示 今天遇到的问题: 方法1:设置GridViewColumn的ActualWidth <ListView > <ListView.View&g ...
- WPF ListView控件设置奇偶行背景色交替变换以及ListViewItem鼠标悬停动画
原文:WPF ListView控件设置奇偶行背景色交替变换以及ListViewItem鼠标悬停动画 利用WPF的ListView控件实现类似于Winform中DataGrid行背景色交替变换的效果,同 ...
- WPF listview item mouse enter/over popup
This is because the routing strategy of the Loaded event is Direct, which means that the routed even ...
- WPF:数据绑定总结(1) https://segmentfault.com/a/1190000012981745
WPF:数据绑定总结(1) visual-studio c# 1.3k 次阅读 · 读完需要 16 分钟 0 一.概念:什么是数据绑定? WPF中的数据绑定:是在应用程序 UI 与业务逻辑之间建立 ...
- [WPF]ListView点击列头排序功能实现
[转] [WPF]ListView点击列头排序功能实现 这是一个非常常见的功能,要求也很简单,在Column Header上显示一个小三角表示表示现在是在哪个Header上的正序还是倒序就可以了. ...
- WPF DataGrid Custommization using Style and Template
WPF DataGrid Custommization using Style and Template 代码下载:http://download.csdn.net/detail/wujicai/81 ...
- WPF ListView 分组 Grouping
在Resource里定义数据源和分组字段: <CollectionViewSource x:Key="listData" Source="{Binding Cate ...
随机推荐
- van Emda Boas
van Emda Boas维护了一个整数集合[0,Max)(无重复),其中Max必须等于2的正整数次幂.它支持以下操作:(1)插入一个数字;(2)删除一个数字:(3)询问某一个数字在不在这个集合中:( ...
- BZOJ 1266 上学路线route(最小割)
题目链接:http://61.187.179.132/JudgeOnline/problem.php?id=1266 题意:给出一个无向图,每条边有长度和代价.求出1到n的最短路.之后删掉一些边使得1 ...
- Apply Root Motion
Apply Root Motion 应用根动作: Should we control the character's position from the animation itself or fro ...
- 未能加载文件或程序集“CefSharp, Version=1.25.XXXX”或它的某一个依赖项。试图加载格式不正确的程序。
在使用CefSharp的过程中遇到一个坑爹的错误. 从GitHub的项目主页:https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-qu ...
- C#在泛型类中,通过表达式树构造lambda表达式
场景 最近对爬虫的数据库架构做调整,需要将数据迁移到MongoDB上去,需要重新实现一个针对MongoDB的Dao泛型类,好吧,动手开工,当实现删除操作的时候问题来了. 我们的删除操作定义如下:voi ...
- 【转】ffmpeg参数中文详细解释
感谢“大神”的无私奉献:http://blog.csdn.net/leixiaohua1020/article/details/15811977 a) 通用选项 -L license-h 帮助-fro ...
- Upgrade Bioconductor
(1)Checking Version of Bioconductor > source("http://bioconductor.org/biocLite.R")Bioco ...
- Django1.9 Python3.4出现Error loading MySQLdb
linux Errorloading MySQLdb module: No module named MySQLdb 这是因为目前 MySQLdb 还不支持 python3.x ,开源无人维护哈 之前 ...
- SpringMVC 服务器端验证
1.导入JSR303验证类库Jar包2.在MVC的配置文件中添加<mvc:annotation-driven/>的配置3.在MVC的配置文件中添加验证器的配置4.在接收表单数据的类中添加验 ...
- C#TextBox自动滚动到最低端
C#中一个RichTextBox,当新写入内容时,超过当前显示区域后,自动滚动到最低端,方便查看内容. private void txtInfo_TextChanged(object sender, ...