/// <summary> /// Obtiene un Renglon en base al Indice del mismo /// </summary> /// <param name="index">Indice del Renglon a Buscar</param> /// <returns>DataGridRow</returns> public DataGridRow GetRow(int index) { var row = (DataGridRow)DgCostoGanado.ItemContainerGenerator.ContainerFromIndex(index); if (row == null) { DgCostoGanado.UpdateLayout(); DgCostoGanado.ScrollIntoView(DgCostoGanado.Items[index]); row = (DataGridRow)DgCostoGanado.ItemContainerGenerator.ContainerFromIndex(index); } return(row); }
/// <summary> /// Obtiene un Renglon en base al Indice del mismo /// </summary> /// <param name="row">Indice del Renglon a Buscar</param> /// <param name="column">Indice de la Columna a Buscar</param> /// <returns>DataGridCell</returns> public DataGridCell GetCell(int row, int column) { var rowContainer = GetRow(row); if (rowContainer != null) { var presenter = GetVisualChild <DataGridCellsPresenter>(rowContainer); if (presenter == null) { DgCostoGanado.ScrollIntoView(rowContainer, DgCostoGanado.Columns[column]); presenter = GetVisualChild <DataGridCellsPresenter>(rowContainer); } var cell = (DataGridCell)presenter.ItemContainerGenerator.ContainerFromIndex(column); return(cell); } return(null); }