In het rooster met de acties van de informatiebestanden de uitgevoerde acties cursief zetten

0000002094     -      31-12-2024

Met deze programmering kunt u de lijnen cursief zetten die overeenstemmen met acties in de roosters met de informatiebestandacties (in plaats van ze te doorstrepen).

De hier geïllustreerde programmering wordt gerealiseerd op basis van een SigCli-customizer die de volgende interfaces implementeert:

De customizer ziet er als volgt uit:

Zoom
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using MercatorApi;
using MercatorUi;
using System.Windows.Forms;
using System.Drawing;
using System.Linq;

namespace SigCli
{
    public class Customizer : MercatorUi.ICustomizers.IFormLoadCustomizer, MercatorUi.ICustomizers.IFormClosedCustomizer
    {
        public void FormLoadCustomize(Form form)
        {
            MercatorUi.Forms.Sig.SigForm sigForm = (MercatorUi.Forms.Sig.SigForm)form;
            MercatorUi.Forms.Sig.SigGrids.Actions actions = sigForm.MovableControls.Values.OfType<MercatorUi.Forms.Sig.SigGrids.Actions>().FirstOrDefault();
            if (actions != null)
                actions.Grid.CellFormatted += Actions_CellFormatted;
        }

        public void FormClosedCustomize(Form form)
        {
            MercatorUi.Forms.Sig.SigForm sigForm = (MercatorUi.Forms.Sig.SigForm)form;
            MercatorUi.Forms.Sig.SigGrids.Actions actions = sigForm.MovableControls.Values.OfType<MercatorUi.Forms.Sig.SigGrids.Actions>().FirstOrDefault();
            if (actions != null)
                actions.Grid.CellFormatted -= Actions_CellFormatted;
        }

        private void Actions_CellFormatted(object sender, DataGridViewCellFormattingEventArgs e)
        {
            DataGridView grid = (DataGridView)sender;
            if (Convert.ToDateTime(grid.Rows[e.RowIndex].Cells["date_done"].Value) > new DateTime(1900, 1, 1))
                e.CellStyle.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Italic, GraphicsUnit.Point, 0);
        }
    }
}

Merk op dat hier gebruik wordt gemaakt van het event CellFormatted van MercatorUi.GridPro.DataGridViewXPro. Dankzij dit event kan het formaat van een cel worden bewerkt, nadat Mercator het standaardevent CellFormatting heeft uitgevoerd.



Functionele cookies: Cookies die nodig zijn voor het gebruik van de website en voorkeurscookies. Ze bevatten geen persoonsgegevens. (Meer informatie)

Analytische cookies: Verzamelen van statistieken met betrekking tot het gedrag van internetgebruikers. (Meer informatie)

Marketingcookies: Om bezoekers op verschillende websites te volgen voor advertentiedoeleinden. (Meer informatie)