We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Filtering problems

ПРЕВЕД УЧАСНЕГИ

I have found some problems when using filtering in GridGroupingControl:

when adding filter on a column and then removing it (selecting "All" filtering menu item) table doesn''t show all it''s rows, it shows records of a previous filter. Manually it could be only fixed when resizing row heights. How could I fix it programatically?

Thank you for answering.

3 Replies

AD Administrator Syncfusion Team August 30, 2006 08:21 AM UTC

Hi Konstantin,

I have created a sample as per your specification. Attached sample works fine with the record filters in a GroupingGrid.

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/Filter_1a20972d.zip

If you can send us a sample that does not work, we can try to debug it here.

Regards,
Haneef


N N October 5, 2006 03:08 PM UTC

КРАСАВЧЕГИ !

Your sample is not usefull.
After I call TableDescriptor.RecordFilters.Remove method filter cell text is not set to "(All)". It
retain the previous selected value.

I use custom FilterBar renderer. But a have no chance to access it''s control text or refresh it. TableControl.GetCellRenderer returns renderer instance not actualy assigned with request position.

I wonder, why it happens? And explain, please, the way to avoid this problem.


AD Administrator Syncfusion Team October 6, 2006 09:41 AM UTC

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=323

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon