0

I have a grid in which the sizes must be at the same height from the description.

private void btnAgregar_Click(object sender, EventArgs e)
{
    dgvProformaDetalle.AutoGenerateColumns = false;
    dgvProformaDetalle.DataSource = FillDgv();
    dgvProformaDetalle.Columns["ColumnId"].DataPropertyName = "ProductoId";
    dgvProformaDetalle.Columns["ColumnDescripcion"].DataPropertyName = "DescripcionProducto";
    dgvProformaDetalle.Columns["ColumnTalla"].DataPropertyName = "DescripcionTalla";
}
private List<DetalleProformaExtendida> FillDgv()
{            
    List<DetalleProformaExtendida> listaArticulo = new List<DetalleProformaExtendida>();

    DetalleProformaExtendida model = new DetalleProformaExtendida
    {
        ProductoId = txtIdProducto.Text,
        DescripcionProducto = txtDescripcion.Text
    };
    listaArticulo.Add(model);
    foreach (Talla item in checkedListBoxTallas.CheckedItems)
    {
        DetalleProformaExtendida _talla = new DetalleProformaExtendida();
        _talla.TallaId = item.TallaId;
        _talla.DescripcionTalla = item.Descripcion;
        listaArticulo.Add(_talla);
    }
    return listaArticulo;
}
1
  • 2
    and what is the question?
    – i486
    Commented Nov 29, 2014 at 20:05

1 Answer 1

1

Maybe you want to set the ContentAlignment of your Cells? Maybe to TopLeft or TopRight?

dgvProformaDetalle.Columns["ColumnDescripcion"].CellTemplate.Style.Alignment = 
                                                DataGridViewContentAlignment.TopLeft;

dgvProformaDetalle.Columns["ColumnTalla"].CellTemplate.Style.Alignment = 
                                          DataGridViewContentAlignment.TopRight;

But I am really just guessing here..

Not the answer you're looking for? Browse other questions tagged or ask your own question.