private void UiListaVistaBodega_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e)
        {
            if (e.ControllerRow >= 0)
            {
                var registro = (Bodega)UiListaVistaBodega.GetRow(e.ControllerRow);
                registro.IS_SELECTED = (e.Action == CollectionChangeAction.Add);
            }
            else
            {
                if (UsuarioSeleccionoListaBodegaCompleta)
                {
                    for (var i = 0; i < UiListaVistaBodega.RowCount; i++)
                    {
                        var registro = (Bodega)UiListaVistaBodega.GetRow(i);
                        if (registro == null)
                        {
                            continue;
                        }
                        registro.IS_SELECTED = (UiListaVistaBodega.SelectedRowsCount != 0);
                    }
                    UsuarioSeleccionoListaBodegaCompleta = false;
                }
            }

            var edit = ActiveControl as DevExpress.XtraEditors.SearchLookUpEdit;

            if (edit == null)
            {
                return;
            }
            edit.Text = ObtenerTextoAMostrarListaBodega();
        }
 private void UiListaVistaBodega_BeforeLeaveRow(object sender, DevExpress.XtraGrid.Views.Base.RowAllowEventArgs e)
 {
     for (var i = 0; i < UiListaVistaBodega.RowCount; i++)
     {
         var registro = (Bodega)UiListaVistaBodega.GetRow(i);
         if (registro == null)
         {
             continue;
         }
         if (registro.IS_SELECTED)
         {
             UiListaVistaBodega.SelectRow(i);
         }
     }
 }