zoukankan
html css js c++ java
WPF绑定ListBox
class Student { public string sno { get; set; } public string sname { get; set; } public string sage { get; set; } }
定义实体类Student
<ListBox Height="163" HorizontalAlignment="Left" Margin="12,12,0,0" Name="listBox1" VerticalAlignment="Top" Width="217" > <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding sno}"/> <TextBlock Text="{Binding sname}"/> <TextBlock Text="{Binding sage}"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
XAML页面设置绑定格式和字段
List<Student> students = new List<Student>(); students.Add(new Student { sno = "1", sname = "王井", sage = "20" }); students.Add(new Student { sno = "2", sname = "高瑞", sage = "21" }); students.Add(new Student { sno = "3", sname = "刘欢", sage = "21" }); listBox1.Items.Clear(); listBox1.ItemsSource = students;
后台绑定数据
查看全文
相关阅读:
转:mac下安装homebrew
jdk1.7下载路径
转: Mac 使用ADT的问题
转:mac下安装Sublime Text
转: SVN和Git的一些用法总结
转: SVN使用教程总结(图文丰富,相当详细)
转:Tortoise SVN 版本控制常用操作知识
Android Java混淆(ProGuard)
转:美团Android资源混淆保护实践
【IPC进程间通讯之三】内存映射文件Mapping File
原文地址:https://www.cnblogs.com/javawebsoa/p/2458007.html
最新文章
mongodb分片balance
mongodb千万级写入怎么优化
mongodb启动很慢
MongoDB内存配置 --wiredTigerCacheSizeGB
进程监控工具supervisor 启动Mongodb
MongoDB高可用集群搭建(主从、分片、路由、安全验证)
mongodb副本集加分片集群安全认证使用账号密码登录
以我的亲身经历为例,告诉大家写简历和面试的技巧(面向高级开发和架构师)
mongodb集群性能优化
Cannot resolve external dependency com.android.support:multidex:1.0.0
热门文章
设置锁屏启动程序的属性
android values目录的读取优先级
git push ERROR: missing Change-Id in commit message footer
Android各种屏幕适配原理
Android 常用的adb命令
android中常用的读取文件的用法如下
Android属性(property)机制
Integer.valueof(null)报错
java中Map和List初始化的两种方法
转:从产品经理的角度算一算,做一个app需要花多少钱?
Copyright © 2011-2022 走看看