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

Radfilter DropDown Highlighted after selection

5 Answers 57 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 11 May 2012, 02:43 PM
hey guys, i noticed that on the RadFilter (not Grid Radfilter) - that when there's a drop down list and something is selected - it stays highlighted - i assume this is by design until of course you click the "Apply" button. in my scenario - i'd like to attach an Enter Key event to the page - which i've done & it works fine. However, when using the DropDown List - this isn't the case. it holds the focus until you say "tab" or do another action.
is there some client code that will give the control back to the page when something is selected??
thanks again for any suggestions on this.
rik

5 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 16 May 2012, 07:03 AM
Hi Rik,

You could attach the combo's OnClientSelectedIndexChanged event and there, focus another control, for example the Apply button, so that when enter is pressed, the button is clicked. You can try attaching the event server-side in the InitializeEditor method of the custom field editor class.

All the best,
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.
0
rik butcher
Top achievements
Rank 1
answered on 16 May 2012, 07:01 PM
i'm not finding that event....in the Filter itself on the Editor inside.
and nothing that i can see in the class.
below is an example of the rad filter w/ the comboboxEditor - also below that is the InitializeEditor from the comboboxeditor class.
any ideas would be appreciated.
once again, thank you so much for your help on everything.
rik

 

 

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

 

 

 

OnPreRender="ReleaseableItemsRadFilter_PreRender" OnApplyExpressions="ReleaseableItemsRadFilter_Apply"

 

 

 

ApplyButtonText="Filter Releases" OnFieldEditorCreating="RadFilter_FieldEditorCreating" OnItemCommand="ReleaseableItemsRadFilter_ItemCommand">

 

 

 

<FieldEditors>

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="WORKORDERITEMDISPLAY" DisplayName="WO Item#"

 

 

 

DataType="System.String" />

 

 

 

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

 

 

 

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

 

 

 

ComboBoxSkin="WebBlue" />

 

 

 

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

 

 

 

DataType="System.String" />

 


 

 

</FieldEditors>

 

 

 

</telerik:RadFilter>

 



here's the initialize Editor from the combobox class:


public

 

 

override void InitializeEditor(Control container)

 

{

comboBox =

 

new RadComboBox();

 

comboBox.ID =

 

"ComboBoxEditor" + FieldName;

 

comboBox.DataSourceID = DataSourceID;

comboBox.DataTextField = (

 

String.IsNullOrEmpty(DataTextField)) ? FieldName : DataTextField;

 

comboBox.DataValueField = (

 

String.IsNullOrEmpty(DataValueField)) ? FieldName : DataValueField;

 

comboBox.Skin = ComboBoxSkin;

comboBox.Width = ComboBoxWidth;

container.Controls.Add(comboBox);

 

}

0
Tsvetina
Telerik team
answered on 19 May 2012, 12:19 PM
Hello Rik,

Have you tried the following:
public override void InitializeEditor(Control container)
{
    comboBox = new RadComboBox();
 
    comboBox.ID =  "ComboBoxEditor" + FieldName;
 
    comboBox.DataSourceID = DataSourceID;
 
    comboBox.OnClientSelectedIndexChanged = "clientSelectedIndexChanged";
 
    comboBox.DataTextField = (String.IsNullOrEmpty(DataTextField)) ? FieldName : DataTextField;
 
    comboBox.DataValueField = (String.IsNullOrEmpty(DataValueField)) ? FieldName : DataValueField;
 
    comboBox.Skin = ComboBoxSkin;
 
    comboBox.Width = ComboBoxWidth;
 
    container.Controls.Add(comboBox);
}

And then, on in javascript:
function clientSelectedIndexChanged(sender, args){
    //focus logic goes here
}


Kind regards,
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.
0
rik butcher
Top achievements
Rank 1
answered on 21 May 2012, 05:13 PM
yes, i did try that w/ measured success. i'll revisit that again -  it seems like that's probably gonna be the only way since the properties don't really exist untill the control is built.
we have, however over 65 rad-filters in our program and on some Mutli-Page .aspx instances. so, being global i'll need to address each one.
i will give this one "another shot" thanks again for your help............. and your patience!!
rik
0
Tsvetina
Telerik team
answered on 21 May 2012, 05:18 PM
Hello Rik,

In terms of reusability this would be actually quite efficient, as you attach this event just once in the custom field editor class. You could also write generic javascript to get the apply button and focus it (using only its class and no IDs). Let me know if you need help with this.

All the best,
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
rik butcher
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
rik butcher
Top achievements
Rank 1
Share this question
or