首页 > 代码库 > datagridview 新增方式

datagridview 新增方式

            //新增
            this.dataGridView1.AllowUserToAddRows = true;
            if (iTag == 1)
            {
                //默认自动编号排序
                dataGridView1.Columns["taskId"].HeaderCell.SortGlyphDirection = SortOrder.Ascending;
                //跳到最后一行
                bindingNavigatorMoveLastItem.PerformClick();
            }
            if (iTag == 2)
            {//默认自动编号排序
                dataGridView1.Columns["planId"].HeaderCell.SortGlyphDirection = SortOrder.Ascending;
                bindingNavigatorMoveLastItem.PerformClick();
            }