为什么C#中在窗体里加了个ListView循环读数据时候多出来最上面一行的default
后台代码:usingSystem.Text;usingSystem.Windows.Forms;usingBLL;usingModel;namespacecaixing....
后台代码:using System.Text;
using System.Windows.Forms;
using BLL;
using Model;
namespace caixing.User
{
public partial class SuperUser : Form
{
public SuperUser()
{
InitializeComponent();
}
private void SuperUser_Load(object sender, EventArgs e)
{
List<UserInfo> list = (List<UserInfo>)UserManage.GetUserAll();
for (int i = 0; i < list.Count; i++)
{
UserInfo user = new UserInfo();
user = list[i];
ListViewItem lv = new ListViewItem(user.UserName.ToString());
lv.Tag = user.UserId;
lv.SubItems.AddRange(new string[] { user.PassWord });
listView1.HeaderStyle = ColumnHeaderStyle.Clickable;
listView1.Items.Add(lv);
}
}
}
} 展开
using System.Windows.Forms;
using BLL;
using Model;
namespace caixing.User
{
public partial class SuperUser : Form
{
public SuperUser()
{
InitializeComponent();
}
private void SuperUser_Load(object sender, EventArgs e)
{
List<UserInfo> list = (List<UserInfo>)UserManage.GetUserAll();
for (int i = 0; i < list.Count; i++)
{
UserInfo user = new UserInfo();
user = list[i];
ListViewItem lv = new ListViewItem(user.UserName.ToString());
lv.Tag = user.UserId;
lv.SubItems.AddRange(new string[] { user.PassWord });
listView1.HeaderStyle = ColumnHeaderStyle.Clickable;
listView1.Items.Add(lv);
}
}
}
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询