private com_cotizacion_compra_Info GetSelectedRow(DevExpress.XtraGrid.Views.Grid.GridView view) { try { return((com_cotizacion_compra_Info)view.GetRow(view.FocusedRowHandle)); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); return(new com_cotizacion_compra_Info()); } }
//PERMITE OBTENER EL REGISTRO ACTUALMENTE SELECCIONADO EN LA GRILLA private ro_Empleado_Info GetSelectedRow(DevExpress.XtraGrid.Views.Grid.GridView view) { try { return((ro_Empleado_Info)view.GetRow(view.FocusedRowHandle)); } catch (Exception ex) { MessageBox.Show(ex.Message); Log_Error_bus.Log_Error(ex.Message); return(new ro_Empleado_Info()); } }
private void CompleteSelected() { var rows = gridView.GetSelectedRows(); if (rows.Length > 0) { this.SelectedItem = gridView.GetRow(rows[0]); } else { this.SelectedIndex = -1; } }
private int FindRowHandleByRowObject(DevExpress.XtraGrid.Views.Grid.GridView view, object row) { if (row != null) { for (int i = 0; i < view.DataRowCount; i++) { if (row.Equals(view.GetRow(i))) { return(i); } } } return(DevExpress.XtraGrid.GridControl.InvalidRowHandle); }
private void Form1_Load(object sender, System.EventArgs e) { DataTable myTable = new DataTable(); myTable.Columns.Add("Product"); for (int i = 1; i <= 3; i++) { myTable.Rows.Add("Product " + i.ToString()); } gridControl1.DataSource = myTable; PrevCheckedRow = 0; CheckedRow = gridView1.GetRow(0); }
private void OnInitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e) { /* * This event is called by the Grid when a new item is create using the new item row. * Here we want to assign default values to our items. */ DevExpress.XtraGrid.Views.Grid.GridView view = sender as GridView; Model.Appointment appointment = view.GetRow(e.RowHandle) as Model.Appointment; if (appointment != null) { appointment.Start = DateTime.Today; appointment.Finish = DateTime.Today; appointment.IsAllDay = true; appointment.ItemType = (int)Model.Appointment.ItemCode.Task; } }
private void ScontrinoRemoveLine(ScontrinoRemoveLineEvents obj) { try { var row = (ScontrinoLineItem)_dgvScontrino.GetRow(_dgvScontrino.FocusedRowHandle); if (row.TipoRigaScontrino == TipoRigaScontrino.Totale || row.TipoRigaScontrino == TipoRigaScontrino.ScontoIncondizionato) { MessageManager.NotificaInfo("Non si elimina il totale o lo sconto"); return; } Datasource.Remove(row); this.Reffreshlist(); } catch (Exception ex) { MessageManager.NotificaError("Errore nella rimozione", ex); } }
public static object GetSelectData(DevExpress.XtraGrid.Views.Grid.GridView rp) { return(rp.GetRow(rp.FocusedRowHandle)); }