This is a migrated thread and some comments may be shown as answers.

Issues with Excel-Like Filtering

4 Answers 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
George Saveliev
Top achievements
Rank 1
George Saveliev asked on 28 Jan 2011, 10:10 AM
Hello!

I have a couple of issues with Excel-Like Filtering in RadGridView v.2010.3.10.1215.

1. The filter dialog title is “RadGridView Filter Dialog [<column>]”. Is it possible to customize it?

2. If both selections in the filter dialog are “No filter”, the following exception is thrown:

Object reference not set to an instance of an object.
at Telerik.WinControls.UI.RadListFilterMenuProvider.ValidateUserFilter(FilterDescriptor descriptor)
at Telerik.WinControls.UI.RadListFilterMenuProvider.EditFilterDescriptor(RadFilterComposeMenuItem menuItem)
at Telerik.WinControls.UI.RadListFilterMenuProvider.FilterMenuItem_Click(Object sender, EventArgs e)
at Telerik.WinControls.RadItem.OnClick(EventArgs e)
at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
at Telerik.WinControls.UI.RadMenuItem.OnClick(EventArgs e)
at Telerik.WinControls.RadItem.DoClick(EventArgs e)
at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)
at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at Telerik.WinControls.UI.RadPopupControlBase.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Is it possible to catch it?

Thank you.

4 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 28 Jan 2011, 11:49 AM
Hello,

I'd like to help you with your query, but I am unsure as to your requirement. Please could you include a screnshot and more details that demonstrates your issue.
Thanks
Richard
0
George Saveliev
Top achievements
Rank 1
answered on 28 Jan 2011, 12:21 PM

Hello, Richard!

Please see attached pictures. I started "Run Demos" coming with RadControls for WinForms Q3 2010 SP1, and went to GridView -> Filtering -> Excel Lke Filtering. Then I clicked the filter button in the "Company Name" column header and selected Available Filters -> Custom (see img1.jpg). The filter dialog was opened (see img2.jpg). Please note the dialog title. Then I left both combo boxes with "No filter and clicked OK button. As a result I got the exception (see img3.jpg).

Thank you.

0
Richard Slade
Top achievements
Rank 2
answered on 28 Jan 2011, 01:22 PM
Hello George,

As far as I'm aware, it is possible to change the custom filter dialog if you are using standard filtering in the following way:

public class MyFilterCell : GridFilterCellElement
{
    private CompositeFilterForm form;
    public MyFilterCell(GridViewDataColumn column, GridRowElement row)
        : base(column, row)
    {
    }
    protected override Type ThemeEffectiveType
    {
        get { return typeof(GridFilterCellElement); }
    }
    protected override CompositeFilterForm CreateCompositeFilterForm()
    {
        form = base.CreateCompositeFilterForm();
        form.TextChanged += new EventHandler(form_TextChanged);
        return form;  
    }
      
    void form_TextChanged(Object sender, EventArgs e)
    {
        if (form.Text != "My Filter Form")
        {
            form.Text = "My Filter Form";
        }
    }
}

this.radGridView1.CreateCell += new GridViewCreateCellEventHandler(radGridView1_CreateCell);

void radGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e)
{
    if (e.CellType == typeof(GridFilterCellElement))
    {
        e.CellType = typeof(MyFilterCell);
    }
}

however, it is not possible as far as I know to get to the Filter Form via the Header Cell where the Excel Like filtering takes place. Therefore, the error that you are also getting I beleive will need to be fixed in an upcoming release.

Hope that helps but let me know if you have further questions
Richard
0
Martin Vasilev
Telerik team
answered on 02 Feb 2011, 04:09 PM
Hi guys,

I managed to reproduce the described exception by George. We will address it in the next major release. George, I have updated your Telerik points for that report.

As to the filtering form customization, Richard is right, we do not support that yet. However we have plans to add this functionality in the future.

Kind regards,
Martin Vasilev
the Telerik team
Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
Tags
GridView
Asked by
George Saveliev
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
George Saveliev
Top achievements
Rank 1
Martin Vasilev
Telerik team
Share this question
or