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

Add custom DropDown to RadFilter

1 Answer 165 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Chamara
Top achievements
Rank 1
Chamara asked on 14 Mar 2012, 01:33 PM
i'm trying to add a RadFilter to filter my RadGrid which has several coulmns.it works fine. now i need to add a dropdown only for a one column filter.i have a column named  Revision in my RadGrid.i'm trying the following but it doesn't work

   <telerik:RadFilter runat="server" ID="RadFilter1" 
                FilterContainerID="gridSearchL3" ShowApplyButton="true" Height="100px" >
                <FieldEditors>
                <custom:RadFilterDropDownEditor DataValueField="Revision" DataTextField="Revision" DataType="System.String" FieldName="Revision" />
       
                </FieldEditors>
                </telerik:RadFilter>

i'm getting the error " Object reference not set to an instance of an object"
for creating custom dropdown i've used following class

http://www.telerik.com/help/aspnet-ajax/filter-custom-editors.html 

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 19 Mar 2012, 10:37 AM
Hi Chamara,

Can you confirm that you have assigned the custom class in the FieldEditorCreating event?
protected void RadFilter1_FieldEditorCreating(object sender, RadFilterFieldEditorCreatingEventArgs e)
{
    if (e.EditorType == "RadFilterDropDownEditor")
    {
        e.Editor = new RadFilterDropDownEditor();
    }
}

If this is not the issue, please share your code, so we can look for any possible mistakes.

Greetings,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Filter
Asked by
Chamara
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or