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

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

4 Answers 41 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 09 Jun 2011, 04:55 PM
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

4 Answers, 1 is accepted

Sort by
0
Cat Cheshire
Top achievements
Rank 1
answered on 09 Jun 2011, 05:08 PM
This RadComboBox behaviour can occur when you've added items with same values.
The values of combo items need to be unique.
0
Tim
Top achievements
Rank 1
answered on 09 Jun 2011, 05:16 PM
The values are unique, clearly NOT the problem.
0
Dimitar Terziev
Telerik team
answered on 14 Jun 2011, 01:46 PM
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.

0
Tim
Top achievements
Rank 1
answered on 14 Jun 2011, 04:22 PM
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.

 

Tags
ComboBox
Asked by
Tim
Top achievements
Rank 1
Answers by
Cat Cheshire
Top achievements
Rank 1
Tim
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Share this question
or