熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

.NET的winform中listview的綁定

2022-06-13   來源: .NET編程 

  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)}


From:http://tw.wingwit.com/Article/program/net/201311/13937.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.