Why don't ComboBoxes used as filters remember their selection state

5 posts, 0 answers
  1. Tim
    Tim avatar
    57 posts
    Member since:
    Apr 2011

    Posted 09 Jun 2011 Link to this post

    Hi

    I have been going round and round on this for days now.

    I have a ComboBox in my FilterTemplate area of a grid.

    I can get the filtering to occur, but the combo ALWAYS reverts to its default selection.

    I thought I had found the magic setting, ViewStateMode, but that didn't work either.

    I have ViewState turned on for the page, for the control, that after all is the default,
    and I have ViewStateMode enabled on my combo.

    But every time I make a selection I see the text area of the combo change.
    I trigger the filter with some client side code, a post back occurs, and wammo!!!
    the combo reverts to its default value.

    Hellllpppppp
  2. Cat Cheshire
    Cat Cheshire avatar
    128 posts
    Member since:
    Jun 2010

    Posted 09 Jun 2011 Link to this post

    This RadComboBox behaviour can occur when you've added items with same values.
    The values of combo items need to be unique.
  3. Tim
    Tim avatar
    57 posts
    Member since:
    Apr 2011

    Posted 09 Jun 2011 Link to this post

    The values are unique, clearly NOT the problem.
  4. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1268 posts

    Posted 14 Jun 2011 Link to this post

    Hello Tim,

    Since I'm not quite sure what is the exact implementation of your scenario, please open a support ticket and provide us with runnable sample project demonstrating the issue.

    This way we could find the cause of your issue more easily.

    All the best,
    Dimitar Terziev
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  5. Tim
    Tim avatar
    57 posts
    Member since:
    Apr 2011

    Posted 14 Jun 2011 Link to this post

    Hi Dimitar

    No need to open a ticket.

    I found the magic pixie dust that solved my problem.

    I need to following on my ComboBox definitions:

    SelectedValue

     

     

    ='<%# ((GridItem)Container).OwnerTableView.GetColumn("StateUnique").CurrentFilterValue %>'

    This will preserve the Combo's selected item across post-backs.

    Just what I need, but thanks for your help.

     

Back to Top