求助!请哪位高手可以帮我看一下我的datagridview怎么删除行啊
namespace qidong{
public partial class Form1 : Form
{
Class1 parameter; //叶片的外形参数
public Form1()
{
InitializeComponent();
Init();
}
public void Init()
{
parameter = new Class1();
parameter.Add(new Item(0, 0, 0, 0, 0, null));
dataGridView1.DataSource = parameter ;
}
private void button1_Click_1(object sender, EventArgs e)
{
//Item s = new Item();
//parameter.Remove(s.Column1 );
dataGridView1.DataSource = null;
dataGridView1.DataSource = parameter;
}
private void button3_Click_1(object sender, EventArgs e)
{
parameter.Add(new Item());
dataGridView1.DataSource = null;
dataGridView1.DataSource = parameter;
}
private void button2_Click_1(object sender, EventArgs e)
{
Class1 cl2 = new Class1();
foreach (Item item in parameter)
{
richTextBox1.Text += item.Column1.ToString ();
//dataGridView2.DataSource = cl2;
}
}
}
}
namespace qidong
{
public class Class1 : List<Item>
{
public Class1() { }
}
public class Item
{
public Item()
{ }
public Item(double d1, double d2, double d3, double d4, double d5, string d6)
{
Column1 = d1;
Column2 = d2;
Column3 = d3;
Column4 = d4;
Column5 = d5;
Column6 = d6;
}
private double _dName1;
private double _dName2;
private double _dName3;
private double _dName4;
private double _dName5;
private string _dName6;
public double Column1
{
get { return _dName1; }
set { _dName1 = value; }
}
public double Column2
{
get { return _dName2; }
set { _dName2 = value; }
}
public double Column3
{
get { return _dName3; }
set { _dName3 = value; }
}
public double Column4
{
get { return _dName4; }
set { _dName4 = value; }
}
public double Column5
{
get { return _dName5; }
set { _dName5 = value; }
}
public string Column6
{
get { return _dName6; }
set { _dName6 = value; }
}
}
}
补充:.NET技术 , C#