protected override void OnMouseClick(MouseEventArgs e)
{
base.OnMouseClick(e);
if (this.IsValidCell(this.LastMouseCell))
{
// Adjust this to take colspan into account
// LastMouseCell may be a cell that is 'under' a colspan cell
CellPos realCell = this.ResolveColspan(this.LastMouseCell);
var cellMouseEventArgs = new CellMouseEventArgs(
this.TableModel[realCell],
this,
realCell,
this.CellRect(realCell),
e);
this.OnCellClick(cellMouseEventArgs);
}
else if (this.hotColumn != -1)
{
var columnHeaderRect = this.ColumnModel.ColumnHeaderRect(this.hotColumn);
var headerRect = this.DisplayRectToClient(columnHeaderRect);
bool handled = false;
// Column filters
if (this.EnableFilters && this.ColumnModel.Columns[hotColumn].Filterable)
{
Point client = this.DisplayRectToClient(e.X, e.Y);
ColumnHeaderRegion region = this.HeaderRenderer.HitTest(client.X, client.Y);
if (region == ColumnHeaderRegion.FilterButton)
{
handled = true;
var mouseEventArgs = new HeaderMouseEventArgs(
this.ColumnModel.Columns[this.hotColumn],
this,
this.hotColumn,
headerRect,
e);
this.OnHeaderFilterClick(mouseEventArgs);
}
}
if (!handled)
{
var mouseEventArgs = new HeaderMouseEventArgs(
this.ColumnModel.Columns[this.hotColumn],
this,
this.hotColumn,
headerRect,
e);
this.OnHeaderClick(mouseEventArgs);
}
}
}