protected void OnDuplicateGridRowCommand() { if (m_SelectedGridRow == null) { Debug.Assert(false); return; } DataGridRowViewModel vm = new DataGridRowViewModel(); vm.Copy(m_SelectedGridRow); m_GridRowCollection.Add(vm); }
protected void OnAddGridRowCommand() { DataGridRowViewModel vm = new DataGridRowViewModel(); vm.NewRow = true; if (m_SelectedGridRow != null) { int i = m_GridRowCollection.IndexOf(m_SelectedGridRow); m_GridRowCollection.Insert(i + 1, vm); } else { m_GridRowCollection.Add(vm); } }
public void Copy(DataGridRowViewModel vm) { this.FirstColumn = vm.FirstColumn; this.SecondColumn = vm.SecondColumn; this.ThirdColumn = vm.ThirdColumn; }