Radfilter DropDown Highlighted after selection

6 posts, 0 answers
  1. rik butcher
    rik butcher avatar
    106 posts
    Member since:
    Jul 2009

    Posted 11 May 2012 Link to this post

    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
  2. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 16 May 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. rik butcher
    rik butcher avatar
    106 posts
    Member since:
    Jul 2009

    Posted 16 May 2012 Link to this post

    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);

     

    }

  5. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 19 May 2012 Link to this post

    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.
  6. rik butcher
    rik butcher avatar
    106 posts
    Member since:
    Jul 2009

    Posted 21 May 2012 Link to this post

    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
  7. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 21 May 2012 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017