Deze code maakt het mogelijk om automatisch het paneel "geavanceerd zoeken" te tonen dat zich links van het historiekrooster van de klantenfiche bevindt.
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using MercatorApi;
using MercatorExtensions;
using MercatorUi;
using System.Windows.Forms;
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;
var history = sigForm.MovableControls.Values.OfType<MercatorUi.Forms.Sig.SigGrids.History>().FirstOrDefault();
if (history != null)
history.AfterColumnsCreated += History_AfterColumnsCreated;
}
public void FormClosedCustomize(Form form)
{
MercatorUi.Forms.Sig.SigForm sigForm = (MercatorUi.Forms.Sig.SigForm)form;
var history = sigForm.MovableControls.Values.OfType<MercatorUi.Forms.Sig.SigGrids.History>().FirstOrDefault();
if (history != null)
history.AfterColumnsCreated -= History_AfterColumnsCreated;
}
private void History_AfterColumnsCreated(object sender, EventArgs e)
{
var history = (MercatorUi.Forms.Sig.SigGrids.History)sender;
if (history.LeftPanel == null)
history.ToggleLeftPanel();
}
}
}