Ce code permet de montrer automatiquement le panneau de recherche avancée situé à gauche de la grille d'historique de la fiche client.
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();
}
}
}