c#

位置:IT落伍者 >> c# >> 浏览文章

.NET的winform中listview的绑定


发布日期:2023年06月04日
 
.NET的winform中listview的绑定

private void FrmXMLShow_Load(object sender EventArgs e)

{ // listview样式设置listViewGridLines = truelistViewFullRowSelect = truelistViewView = ViewDetailslistViewScrollable = falselistViewMultiSelect = falselistViewHeaderStyle = ColumnHeaderStyleClickable// 表头设置listViewColumnsAdd(ID HorizontalAlignmentCenter)listViewColumnsAdd(姓名 HorizontalAlignmentCenter)listViewColumnsAdd(性别 HorizontalAlignmentCenter)listViewColumnsAdd(年龄 HorizontalAlignmentCenter)listViewColumnsAdd(学校 HorizontalAlignmentCenter)listViewColumnsAdd(联系电话 HorizontalAlignmentCenter)

foreach (Information i in ixsReadAllInformation())

{ ListViewItem item = new ListViewItem()itemSubItemsClear()itemText = iIditemSubItemsAdd(iName)itemSubItemsAdd(iGender)itemSubItemsAdd(iAgeToString())itemSubItemsAdd(iUniversity)itemSubItemsAdd(iPhone)listViewItemsAdd(item)}

上一篇:c#窗体事件

下一篇:程序员提高C#编程水平的50个要点