Hello Dominik,
Here is a custom filter cell class that adds a button to the right:
class
MyFilterCellElement : GridFilterCellElement
{
public
MyFilterCellElement(GridViewDataColumn column, GridRowElement row) :
base
(column, row)
{
}
protected
override
Type ThemeEffectiveType
{
get
{
return
typeof
(GridFilterCellElement);
}
}
RadButtonElement button =
new
RadButtonElement();
protected
override
void
CreateChildElements()
{
base
.CreateChildElements();
this
.FilterButton.Margin =
new
Padding(-5, 0, 15, 0);
button.ZIndex = 100;
button.Text =
"C"
;
button.Click += Button_Click;
this
.Children.Add(button);
}
private
void
Button_Click(
object
sender, EventArgs e)
{
foreach
(FilterDescriptor item
in
this
.GridControl.FilterDescriptors.ToList())
{
if
(item.PropertyName ==
this
.ColumnInfo.FieldName)
{
this
.GridControl.FilterDescriptors.Remove(item);
}
}
}
protected
override
SizeF ArrangeOverride(SizeF finalSize)
{
var res =
base
.ArrangeOverride(finalSize);
var rect =
new
RectangleF(res.Width - button.DesiredSize.Width, (res.Height - button.DesiredSize.Height) / 2, button.DesiredSize.Width, button.DesiredSize.Height);
button.Arrange(rect);
return
res;
}
}
To change the cell you need to use the
CreateCell event:
I hope this will be useful.
Regards,
Dimitar
Telerik by Progress