c #devexpress datagrid添加行转换类型错误

时间:2017-03-19 17:09:00

标签: c# datagridview devexpress

我想在代码中添加新行时出错;有一个类型错误voint to int。

问题行:clmm = gridView1.AddNewRow();

这里是我的代码;

namespace sensor_measure
{
    public partial class Form1 : Form
    {
        int clmm= 1;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            serialPort1.Close();
            DateTime new= DateTime.Now;


        }

        private void button1_Click(object sender, EventArgs e)
        {
            serialPort1.PortName = "COM3";
            serialPort1.Open();
            timer1.Enabled = true;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {

            timem= (timem+ 1);
            come = serialPort1.ReadLine();
            this.chartControl1.Series["Veri"].Points.Add(new SeriesPoint(timem, come));

          clmm=gridView1.AddNewRow();

1 个答案:

答案 0 :(得分:1)

GridView.AddNewRow Method被声明为

public override void AddNewRow()

并且返回类型为void