Hi Nikolaj,
By default, The Filterbar cell doesn''t show the "(All)" and "(Empty)" options in a grid. But you do this by derving the GridFilterBarCellRenderer and override the OnDraw method to draw the filterbar cell with All options.
protected override void OnDraw(Graphics g, Rectangle clientRectangle, int rowIndex, int colIndex, GridStyleInfo style)
{
if( ListBoxPart != null )
{
style.CellValue = ListBoxPart.SelectedItem;
base.OnDraw (g, clientRectangle, rowIndex, colIndex, style);
style.CellValue = GridFilterBarText(style);
}
}
You can use the ListBoxPart.SelecteItem property of the GridFilterBarCellRenderer to get the selected value(control text) in the GridFilterBarCell in a grid. Below is a code snippet.
private void gridTableControlCurrentCellCloseDropDown(object sender, GridTableControlPopupClosedEventArgs e)
{
GridTableFilterBarCellRenderer cr = this.grid.TableControl.CellRenderers["FilterBarCell"] as GridTableFilterBarCellRenderer;
if( cr != null)
Console.WriteLine( " SelectedItem : " + cr.ListBoxPart.SelectedItem );
}
Please refer to this KB article for customize the filterbar entry in a grid.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=323Best Regards,
Haneef