/// <summary> /// 修改焦点对象 /// </summary> public void UpdateObject() { //获取焦点对象 PSP_bdz_type obj = FocusedObject; if (obj == null) { return; } int i = gridView.FocusedRowHandle; //创建对象的一个副本 //LineType objCopy = new LineType(); //DataConverter.CopyTo<LineType>(obj, objCopy); //执行修改操作 using (FrmbdzTypeDialog dlg = new FrmbdzTypeDialog()) { dlg.Object = obj; //绑定副本 if (dlg.ShowDialog() != DialogResult.OK) { return; } } //RefreshData(); gridControl.RefreshDataSource(); gridView.FocusedRowHandle = i; }
/// <summary> /// 添加对象 /// </summary> public void AddObject() { //检查对象链表是否已经加载 if (ObjectList == null) { return; } //新建对象 PSP_bdz_type obj = new PSP_bdz_type(); //执行添加操作 using (FrmbdzTypeDialog dlg = new FrmbdzTypeDialog()) { dlg.IsCreate = true; //设置新建标志 dlg.Typeid = typeid; dlg.Object = obj; if (dlg.ShowDialog() != DialogResult.OK) { return; } } ObjectList.Add(obj); //刷新表格,并将焦点行定位到新对象上。 gridControl.RefreshDataSource(); GridHelper.FocuseRow(this.gridView, obj); //RefreshData(); //GridHelper.FocuseRow(this.gridView, obj); //gridView.FocusedRowHandle = gridView.RowCount; }
/// <summary> /// ��Ӷ��� /// </summary> public void AddObject() { //�����������Ƿ��Ѿ����� if (ObjectList == null) { return; } //�½����� PSP_bdz_type obj = new PSP_bdz_type(); //ִ����Ӳ��� using (FrmbdzTypeDialog dlg = new FrmbdzTypeDialog()) { dlg.IsCreate = true; //�����½���־ dlg.Typeid = typeid; dlg.Object = obj; if (dlg.ShowDialog() != DialogResult.OK) { return; } } ObjectList.Add(obj); //ˢ�±���������ж�λ���¶����ϡ� gridControl.RefreshDataSource(); GridHelper.FocuseRow(this.gridView, obj); //RefreshData(); //GridHelper.FocuseRow(this.gridView, obj); //gridView.FocusedRowHandle = gridView.RowCount; }
/// <summary> /// �Ľ������ /// </summary> public void UpdateObject() { //��ȡ������� PSP_bdz_type obj = FocusedObject; if (obj == null) { return; } int i=gridView.FocusedRowHandle; //���������һ������ //LineType objCopy = new LineType(); //DataConverter.CopyTo<LineType>(obj, objCopy); //ִ���IJ��� using (FrmbdzTypeDialog dlg = new FrmbdzTypeDialog()) { dlg.Object = obj; //���� if (dlg.ShowDialog() != DialogResult.OK) { return; } } //RefreshData(); gridControl.RefreshDataSource(); gridView.FocusedRowHandle = i; }