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

AppendDataBoundItems does...?

2 Answers 477 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ManniAT
Top achievements
Rank 2
ManniAT asked on 26 Jul 2009, 05:22 PM
Hi,

I thought AppendDataBoundItems does add items from databinding to the existing "markup items".
So a grid defined like this:
<telerik:RadComboBox Width="200px" ID="cbJugendlicherZiel" runat="server" DataSourceID="ldsJugendlicheZiel" SelecetedValue="-1" AppendDataBoundItems="true" DataTextField="Kennung" DataValueField="JugendlicherID" AutoPostBack="true">  
            <Items> 
                <telerik:RadComboBoxItem Text="auswählen..." Value="-1" /> 
            </Items> 
    </telerik:RadComboBox> 
offers the "auswählen..." item plus the items from databinding.

This seems to be incorrect - instead AppendDataBoundItems adds new databound items to the existing ones - no matter where the come from.
In other words - if I "autobind" (datasource filtered via Control Parameter) every binding adds it's items to the one in the combobox.
Example: I have a radiobutton array - when I select something there it works as parameter for the datasource of the combobox.
At startup the combo has only the value "select something...". Than I check one of the radiobuttons - and the datasource give "One, Two, Three" - wich results in the following Combobox items:
"select something..."
One
Two
Three
--So far it works as I expected.
Now I check a different radiobutton - my datasource gives "Four, Five" for this selection:
The combo now has:
"select something..."
One
Two
Three
Four
Five

Instead of
"select something..."
Four
Five
--As I would expect.

Is this like it should be?
If so I have to rethink the use of AppenDataboundItems - and go back to datasources with a "dummy record".

Regards

Manfred

2 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 27 Jul 2009, 01:28 PM
Hello Manfred,

Actually this is the expected behavior of AppendDataBoundItems property - it adds new databound items to the existing ones. So I recommend using "dummy record" in your case.

Greetings,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
ManniAT
Top achievements
Rank 2
answered on 27 Jul 2009, 01:59 PM
Hi Yana,

I was afraid, you would say that :)

Thanks for your answer

Manfred
Tags
Grid
Asked by
ManniAT
Top achievements
Rank 2
Answers by
Yana
Telerik team
ManniAT
Top achievements
Rank 2
Share this question
or