private void RecargarSeleccionCosteos()
 {
     for (var i = 0; i < UiVistaCosteos.RowCount; i++)
     {
         var documento = (PolizaMaestroDetalle)UiVistaCosteos.GetRow(i);
         if (documento == null)
         {
             continue;
         }
         if (documento.IS_SELECTED)
         {
             UiVistaCosteos.SelectRow(i);
         }
     }
 }
        private void ExportalAExcel()
        {
            if (UiContenedorCosteos.DataSource == null)
            {
                return;
            }
            if (UiVistaCosteos.RowCount <= 0)
            {
                return;
            }

            var dialog = new SaveFileDialog
            {
                DefaultExt = "xlsx",
                Filter     = @"Archivos de excel (*.xlsx)|*.xlsx"
            };

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            UiVistaCosteos.ExportToXlsx(dialog.FileName);
        }
 private void UiVistaCosteos_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e)
 {
     if (e.ControllerRow >= 0)
     {
         var documento = (PolizaMaestroDetalle)UiVistaCosteos.GetRow(e.ControllerRow);
         documento.IS_SELECTED = (e.Action == CollectionChangeAction.Add);
     }
     else
     {
         if (UsuarioSeleccionoVistaCosteosCompleta)
         {
             for (var i = 0; i < UiVistaCosteos.RowCount; i++)
             {
                 var documento = (PolizaMaestroDetalle)UiVistaCosteos.GetRow(i);
                 if (documento == null)
                 {
                     continue;
                 }
                 documento.IS_SELECTED = (UiVistaCosteos.SelectedRowsCount != 0);
             }
             UsuarioSeleccionoVistaCosteosCompleta = false;
         }
     }
 }
 private void UiBotonContraer_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     UiVistaCosteos.CollapseAllGroups();
 }
 private void UiBotonExpandir_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     UiVistaCosteos.ExpandAllGroups();
 }