想配置下拉列表之间的关联,但总是报错,请问是什么原因呢

想实现下拉菜单的关联,比如选择第一列工序,第二列便只出现与它有关的内容,但在选择第二列时,不知为何总是报错,相关的代码与截图如下,请指点一下,是哪里的问题;

img

img

 private void ComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataGridViewComboBoxEditingControl processcolumn = sender as DataGridViewComboBoxEditingControl; 
            string selectedprocess = processcolumn.SelectedValue.ToString();

            int currentColumnIndex = dataGridView1.CurrentCell.ColumnIndex;
            int nextColumnIndex = currentColumnIndex + 1;

            // 根据当前列的索引来判断下一列是否存在
            if (nextColumnIndex < dataGridView1.Columns.Count)
            {
                DataGridViewComboBoxColumn nextColumn = dataGridView1.Columns[nextColumnIndex] as DataGridViewComboBoxColumn;

                // 根据选中的产品,筛选出对应的规格信息
                List<string> filteredprocessList = GetFilteredprocessList(selectedProcess);

                nextColumn.DataSource = filteredprocessList;
            }

        }

        private List<string> GetFilteredprocessList(string product)
        {
            // 根据选中的产品,返回对应的规格列表
            // 这里假设你有一个方法可以根据产品获取对应的规格信息
            List<string> process = new List<string>();

            switch (product)
            {
                case "制粒":
                    process = new List<string> { "产品1" };
                    break;

                case "提取":
                    process = new List<string> { "产品2" };
                    break;

            }

            return process;

        }