|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DgvFilterPopup;
namespace DgvFilterPopupDemo {
public partial class CustomizedFilterHost : DgvBaseFilterHost {
public CustomizedFilterHost() {
InitializeComponent();
this.Region = BitmapToRegion((Bitmap)this.BackgroundImage,Color.FromArgb(255, 0, 0));
this.CurrentColumnFilterChanged += new EventHandler(CloudFilterHost_CurrentColumnFilterChanged);
lblDelete.BackColor = Color.Transparent;
lblDeleteAll.BackColor = Color.Transparent;
lblOK.BackColor = Color.Transparent;
}
void CloudFilterHost_CurrentColumnFilterChanged(object sender, EventArgs e) {
label1.Text = CurrentColumnFilter.OriginalDataGridViewColumnHeaderText;
}
protected override void DoAutoFit() {
//This empty override of the DoAutoFit force the fixed size of the host.
//We just allow alignment
AlignFilter();
}
public override Control FilterClientArea {
get {
return this.panel1;
}
}
private void lblDelete_Click(object sender, EventArgs e) {
FilterManager.ActivateFilter(false);
this.Popup.Close();
}
private void lblDeleteAll_Click(object sender, EventArgs e) {
FilterManager.ActivateAllFilters(false);
this.Popup.Close();
}
private void lblOK_Click(object sender, EventArgs e) {
FilterManager.ActivateFilter(true);
this.Popup.Close();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm a graduate in Computer Science.
I work with Metatrader MQL4,MQL5 / C# / Asp.Net / Windows Forms / SQL Server / Access / VBA / HTML / CSS / Javascript / classic C/C++.
I also like writing songs and playing around with my band
Diversamente Rossi.
This is the video of the song
Un'altra estate from the album
L'immobile disegno.
"Short code, good code"