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

Filter Methods not working

2 Answers 63 Views
Filter
This is a migrated thread and some comments may be shown as answers.
rik butcher
Top achievements
Rank 1
rik butcher asked on 06 Jul 2011, 05:40 PM
i have a rad Filter like below. i want to switch out the Display Name based on a condition.

<

 

 

telerik:RadFilter ID="WorkOrdersRadFilter" runat="server" Skin="WebBlue" ShowApplyButton="true"

 

 

 

OnApplyExpressions="WorkOrdersRadFilter_Apply" ApplyButtonText="Filter Work Orders"

 

 

 

OnPreRender="RadFilter_PreRender" OnFieldEditorCreating="RadFilter_FieldEditorCreating"

 

 

 

 

 

OnFieldEditorCreated

 

 

="RadFilter_FieldEditorCreated"

 

 

>
<FieldEditors>

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="WORKORDERNUMBER" DisplayName="Work Order#"

 

 

 

DataType="System.String" />

 

 

 

 

<

 

 

goldcustom:RadFilterComboBoxEditor FieldName="WOTYPENAME" DisplayName="WO Type"

 

 

 

 

 

 

 

DataTextField="WOTYPENAME" DataSourceID="WorkOrderTypeFilterODS" DataType="System.String"

 

 

 

 

 

 

 

ComboBoxSkin="WebBlue" />

 

 

 

 

<

 

 

telerik:RadFilterTextFieldEditor FieldName="TRACKINGNUMBER" DisplayName="Tracking#"

 

 

 

DataType="System.String" />

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="KEYREFERENCE" DisplayName="Key Ref"

 

 

 

DataType="System.String" />

 

</FieldEditors>

 

 

 

</telerik:RadFilter>
i tried what was suggested in one of the tutorials, but it never seems to fire this event.i also tried OnFieldEditorCreating which simply is used to invoke the class for radComboBoxes and that never fires either unless of course it's a radComboBox.
i assume that i want to do this when i click the "Add Expression" button on the RadFilter. is there some way i can switch out the DisplayName?? i've been thru every tutorial i can find, but nothing really works.
can i get some direct help? i'm a registered developer, do you guys need any info from me?
thanks
rik


Want to run something like this to switch out the Display name depending on a condition:

 

protected void RadFilter_FieldEditorCreated(object sender, RadFilterFieldEditorCreatedEventArgs e)

{

    if (e.Editor.FieldName == "WORKORDERNUMBER")

    {

        e.Editor.DisplayName = "My custom text";

    }

}

2 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 11 Jul 2011, 04:35 PM
Hello Rik,

The OnFieldEditorCreating and OnFieldEditorCreated events are raised for custom field editors only.
In order to implement the desired functionality, I recommend that find the corresponding editor in the FieldEditors collection and set its display name:
protected void Page_Load(object sender, EventArgs e)
{
    (RadFilter1.FieldEditors[1] as RadFilterTextFieldEditor).DisplayName = "DisplayName";
}

I hope this helps.

Greetings,
Mira
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
rik butcher
Top achievements
Rank 1
answered on 11 Jul 2011, 05:11 PM
that will totally work for what we are doing. thank you so much.
rik
Tags
Filter
Asked by
rik butcher
Top achievements
Rank 1
Answers by
Mira
Telerik team
rik butcher
Top achievements
Rank 1
Share this question
or