Exemplo n.º 1
0
        /// <summary>
        /// 줄 복사를 처리한다.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolStripMenuItem5_Click(object sender, EventArgs e)
        {
            DataTable Dt = (DataTable)gridControl1.DataSource;


            //DataRow를 Copy한다.
            DataRow Dr = CUtil.CopyDataRow(Dt, adView1.GetFocusedDataRow());

            long nCurKey    = 0;
            long nOrderSeq  = 0;
            long nTotRecord = 0;

            nTotRecord = Dt.Rows.Count + 1;
            //복사해서 새로 생긴 Record는 Key값은 최종 Record Count로 지정한다.
            Dr["key"] = nTotRecord;
            nOrderSeq = Convert.ToInt64(Dr["order_seq"].ToString());
            nCurKey   = Convert.ToInt64(Dr["key"].ToString());

            foreach (DataRow item in Dt.Rows)
            {
                long nSeq = Convert.ToInt64(item["order_seq"].ToString());

                if (nSeq >= nOrderSeq)
                {
                    item["order_seq"] = ++nSeq;
                }
            }
            Dt.Rows.InsertAt(Dr, adView1.GetFocusedDataSourceRowIndex());
        }