In some cases, when the default filter row editor's functionality is not enough, you can provide custom filter cell content using the FilterTemplate.
In this example, a default cell editor is replaced with the ASPxGridLookup control. The control's ValueChanged client-side event is used to send a callback to the server side, invoking the grid's CustomCallback event. In the event handler, a filter criteria is created and applied to the grid using the ApplyFilterToColumn method.
Question Comments
Added By: jasanguineti at: 1/13/2014 7:12:39 AM
Please how set it filtertemplate in runtime?
thanks very much.
Added By: Ruslan (DevExpress) at: 1/13/2014 8:26:17 AMIt's quite simple.
You need create a class that implements the ITemplate interface and assign template object to the GridViewDataColumn.FilterTemplate property.
protected void Grid_Init(object sender, EventArgs e) {
var grid = (ASPxGridView)sender;
grid.DataColumns["CategoryName"].FilterTemplate = new CustomFilterTemplate();
}
...
public class CustomFilterTemplate : ITemplate {
public void InstantiateIn(Control container) {
var lookup = new ASPxGridLookup();
lookup.ID = "Lookup";
container.Controls.Add(lookup);
}
}