public void AddRow(DevExpress.XtraGrid.Views.Grid.GridView View) { int currentRow; currentRow = View.FocusedRowHandle; if (currentRow < 0) { currentRow = View.GetDataRowHandleByGroupRowHandle(currentRow); } if (View.GroupedColumns.Count == 0) { return; } string grp = View.GetRowCellValue(currentRow, colGRP).ToString(); GenelDataSet.XGTRow xgtRow = this.genelDataSet.XGT.FindByGRPID(grp, "+"); if (xgtRow.SYS == "M" || xgtRow.SYS == "V") // Grup Modify ise eklenebilir { View.AddNewRow(); View.SetRowCellValue(View.FocusedRowHandle, colGRP, grp); View.SetRowCellValue(View.FocusedRowHandle, colID, ""); View.SetRowCellValue(View.FocusedRowHandle, colSYS, "V"); // User Modify View.UpdateCurrentRow(); View.MakeRowVisible(View.FocusedRowHandle, true); View.ShowEditor(); } }
static void gv_EditorOn(object sender) { DevExpress.XtraGrid.Views.Grid.GridView gv = sender as DevExpress.XtraGrid.Views.Grid.GridView; gv.OptionsBehavior.Editable = true; dtEdit = DateTime.Now; gv.ShowEditor(); }
protected virtual void GridControl_ProcessGridKey(object sender, KeyEventArgs e) { DevExpress.XtraGrid.GridControl gridctrl = sender as DevExpress.XtraGrid.GridControl; DevExpress.XtraGrid.Views.Grid.GridView gridView = (DevExpress.XtraGrid.Views.Grid.GridView) this.DefaultView; if (e.KeyCode == Keys.Tab || e.KeyCode == Keys.Enter) { if (gridView.FocusedRowHandle == DevExpress.XtraGrid.GridControl.NewItemRowHandle) { gridView.AddNewRow(); } gridView.FocusedRowHandle = DevExpress.XtraGrid.GridControl.NewItemRowHandle; gridView.FocusedColumn = gridView.VisibleColumns[0]; gridView.ShowEditor(); } }
private void btnFind_Click(object sender, System.EventArgs e) { int rowHandle = GetRowHandleByColumnValue(gridView1, "CustomerID", "DRACD"); if (rowHandle != GridControl.InvalidRowHandle) { gridView1.FocusedColumn = gridView1.Columns.ColumnByFieldName("CustomerID"); gridView1.FocusedRowHandle = rowHandle; if (gridView1.IsRowVisible(rowHandle) == RowVisibleState.Hidden) { gridView1.MakeRowVisible(rowHandle, false); } gridView1.ShowEditor(); } else { MessageBox.Show("Not found!"); } }
private void repImg_Popup(object sender, EventArgs e) { if (!(sender is DevExpress.XtraEditors.ImageEdit)) { return; } DevExpress.XtraEditors.ImageEdit repImg = sender as DevExpress.XtraEditors.ImageEdit; DevExpress.XtraGrid.Views.Grid.GridView gv = (repImg.Parent as DevExpress.XtraGrid.GridControl).MainView as DevExpress.XtraGrid.Views.Grid.GridView; DataRow _tpDr = gv.GetDataRow(gv.FocusedRowHandle); if (_tpDr["Icon"].Equals(System.DBNull.Value)) { byte[] _tpBytes = ServerRefManager.PicFileRead(_tpDr["StylePic"].ToString(), _tpDr["Pic_Version"].ToString()); gv.FocusedColumn = gv.Columns["Icon"]; gv.ShowEditor(); if (gv.ActiveEditor is DevExpress.XtraEditors.ImageEdit) { if (repImg.Properties.ShowPopupShadow == false) { repImg.ShowPopup(); } } if (_tpBytes == null) { _tpDr["Icon"] = new byte[1]; } else { _tpDr["Icon"] = _tpBytes; } gv.RefreshRow(gv.FocusedRowHandle); repImg.ShowPopup(); } }