Listbox简单用法
<ListBox x:Name="ListBoxPatientAllergy" Grid.Row="1"
ItemContainerStyle="{StaticResource ListboxStyle}"
Background="Transparent" BorderThickness="0"
Foreground="Black"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.PanningMode="None"
ItemsSource="{Binding Path=PatientAllergyEntityList}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="170"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<sync:DateTimeEdit x:Name="dpPatientAllergy"
Height="28" Width="100" Margin="0,0,0,5"
DateTime="{Binding Path=Date, Mode=TwoWay}"
CustomPattern="dd MMM yyyy"
MinDateTime="01 Jan 1800"/>
<TextBox Name="TxtPatientAllergy" Grid.Column="1"
HorizontalAlignment="Stretch" Height="28"
MaxLength="100" Margin="2,0,0,5" VerticalContentAlignment="Center"
Validation.Error="Validation_Error"
Text="{Binding Path=Description,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"/>
<ComboBox Name="CmbPatientAllergy" Grid.Column="2" VerticalContentAlignment="Center"
ItemContainerStyle="{StaticResource ComboBoxItemStyle}"
Background="White" Margin="2,0,0,5" Height="28"
ItemsSource="{Binding RelativeSource={RelativeSource Findancestor, AncestorType={x:Type UserControl}}, Path=DataContext.CodeTables.CTPatientAllergyStatusEntityList}"
DisplayMemberPath="DisplayValue"
SelectedValuePath="PatientAllergyStatusID"
SelectedValue="{Binding Path=PatientAllergyStatusFK, Mode=TwoWay}"/>
<Button x:Name="BtnDeletePatientAllergy" Grid.Column="3"
Margin="2,2,2,5" BorderThickness="0" BorderBrush="White" HorizontalAlignment="Center"
Height="28" Width="30"
Click="BtnDeletePatientAllergy_Click">
<Button.Template>
<ControlTemplate TargetType="Button">
<Image Width="24" Height="24"
HorizontalAlignment="Center" VerticalAlignment="Center"
Source="pack://application:,,,/Medisys.SEMR.WPFClient.Controls.Resource;component/Image/DeleteIcon.png" />
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
事件:
private void BtnDeletePatientAllergy_Click(object sender, RoutedEventArgs e)
{
object obj = ((Button)sender).DataContext;
if (obj == null)
return;
else
{
PatientAllergyEntity PatientAllergyEntity = obj as PatientAllergyEntity;
if (PatientAllergyEntityList != null
&& PatientAllergyEntity.PatientAllergyID != null && PatientAllergyEntity.PatientAllergyID != Guid.Empty)
{
PatientAllergyEntityList.Remove(PatientAllergyEntity);
}
}
}
Listbox简单用法的更多相关文章
- C# Winfom 中ListBox的简单用法
https://www.cnblogs.com/xielong/p/6744805.html Winform控件ListBox的用法 1.如何添加listBox的值 this.listBox1.Ite ...
- CATransition(os开发之画面切换) 的简单用法
CATransition 的简单用法 //引进CATransition 时要添加包“QuartzCore.framework”,然后引进“#import <QuartzCore/QuartzCo ...
- jquery.validate.js 表单验证简单用法
引入jquery.validate.js插件以及Jquery,在最后加上这个插件的方法名来引用.$('form').validate(); <!DOCTYPE html PUBLIC " ...
- NSCharacterSet 简单用法
NSCharacterSet 简单用法 NSCharacterSet其实是许多字符或者数字或者符号的组合,在网络处理的时候会用到 NSMutableCharacterSet *base = [NSMu ...
- [转]Valgrind简单用法
[转]Valgrind简单用法 http://www.cnblogs.com/sunyubo/archive/2010/05/05/2282170.html Valgrind的主要作者Julian S ...
- Oracle的substr函数简单用法
substr(字符串,截取开始位置,截取长度) //返回截取的字 substr('Hello World',0,1) //返回结果为 'H' *从字符串第一个字符开始截取长度为1的字符串 subst ...
- Ext.Net学习笔记19:Ext.Net FormPanel 简单用法
Ext.Net学习笔记19:Ext.Net FormPanel 简单用法 FormPanel是一个常用的控件,Ext.Net中的FormPanel控件同样具有非常丰富的功能,在接下来的笔记中我们将一起 ...
- TransactionScope简单用法
记录TransactionScope简单用法,示例如下: void Test() { using (TransactionScope scope = new TransactionScope()) { ...
- WPF之Treeview控件简单用法
TreeView:表示显示在树结构中分层数据具有项目可展开和折叠的控件 TreeView 的内容是可以包含丰富内容的 TreeViewItem 控件,如 Button 和 Image 控件.TreeV ...
随机推荐
- [Mongdb] 关于Replica Set复制集奇数成员限制的解释--待完善
一.缘由: http://blog.itpub.net/29254281/viewspace-1176821/ http://blog.chinaunix.net/uid-20726500-id-54 ...
- javascript slice
定义和用法 slice() 方法可提取字符串的某个部分,并以新的字符串返回被提取的部分. 语法 stringObject.slice(start,end) 参数 描述 start 要抽取的片断的起始下 ...
- iOS 跳转至AppStore评分页面
iOS7之前: [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"itms-apps://ax.itunes. ...
- [Linux编程] module_param()函数学习笔记
在读TCP cubic源码中,遇到了module_param(),网上查到的资料如下: 在用户态下编程可以通过main()来传递命令行参数,而编写一个内核模块则可通过module_param()来传递 ...
- LeetCode 371. Sum of Two Integers
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Exam ...
- js截取url的参数(转自。。)
用JS获取地址栏参数的方法(超级简单) 方法一:采用正则表达式获取地址栏参数:( 强烈推荐,既实用又方便!) function GetQueryString(name) { var reg ...
- 在sql server使用链接服务器中访问mysql
----创建ODBC链接EXEC sp_addlinkedserver @server = 'MySQL', @srvproduct='MySql' , @provider = 'MSDASQL', ...
- 头像上传,拖拽,裁切(HTML5)版本
演示地址: http://codeman35.itongyin.com:19002/v1/web_demo.html 功能: 支持滚轴放大缩小,鼠标拖动,裁切可视区域
- arcgis如何制作DEM数据
DEM描述的是地面高程信息,它在测绘.水文.气象.地貌.地质.土壤.工程建设.通讯.军事等国民经济和国防建设以及人文和自然科学领域有着广泛的应用.如在工程建设上,可用于如土方量计算.通视分析等:在防洪 ...
- Ixia测试仪的自动化
Ixia,美国Ixia公司的通信网络测试仪. 1.Ixia的自动化测试场景 测试PC(安装IxOS)AT框架-->Tcl驱动库SIG_Teq_Ixia.tcl(加载 IxTclHal库)---- ...