一个.net构造表格的问题
是这样,下面这段程序的目的我是为了实现在VIN码这列加入数据的功能,也只加这一列,这上面有一段基本一样的程序,我已经添加了表格并在里面加了除VIN码的其他数据,下面就是要插入VIN码这一列的程序,其实这个问题也可以说是关于 for (i_index = 0; i_index < 2; i_index++){
ListViewItem listItem = new ListViewItem(ScrewCode[cob_screw.SelectedIndex].ToString() + " " + ScrewName[cob_screw.SelectedIndex].ToString());
这一段怎么用?谢谢大神了,急!
private void InsertListView1()
{
int i_index;
int i_value;
double d_value;
double d_temp1, d_temp2;
listScrew.Clear();
this.listScrew.View = View.Details;
listScrew.Columns.Add("ScrewName", 250, HorizontalAlignment.Center);
listScrew.Columns.Add("CarType", 80, HorizontalAlignment.Center);
listScrew.Columns.Add("Car Number", 100, HorizontalAlignment.Center);
listScrew.Columns.Add("OK Number", 100, HorizontalAlignment.Center);
listScrew.Columns.Add("VIN", 250, HorizontalAlignment.Center);//¥自己加¥
listScrew.Columns.Add("NOK Number", 100, HorizontalAlignment.Center);
listScrew.Columns.Add("Rate", 100, HorizontalAlignment.Center);
listScrew.MultiSelect = false;
listScrew.FullRowSelect = true;
// Allow the user to edit item text.
listScrew.LabelEdit = true;
// Allow the user to rearrange columns.
listScrew.AllowColumnReorder = true;
// Display grid lines.
listScrew.GridLines = true;
// Sort the items in the list in ascending order.
//listScrew.Sorting = SortOrder.Ascending;
for (i_index = 0; i_index < 2; i_index++)
{
ListViewItem listItem = new ListViewItem(ScrewCode[cob_screw.SelectedIndex].ToString() + " " + ScrewName[cob_screw.SelectedIndex].ToString());
listItem.SubItems.Add(new ListViewItem.ListViewSubItem(
listItem, VIN[i_index].ToString()));//¥自己加¥
i_value = Convert.ToInt16(Car_count[i_index]) - Convert.ToInt16(Nok_count[i_index]);
listItem.SubItems.Add(new ListViewItem.ListViewSubItem(
listItem, i_value.ToString()));
listScrew.Items.Add(listItem);
}
} .NET 数据库
补充:.NET技术 , 图表区