AppendDataBoundItems does...?

3 posts, 1 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 26 Jul 2009 Link to this post

    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. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 27 Jul 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 27 Jul 2009 Link to this post

    Hi Yana,

    I was afraid, you would say that :)

    Thanks for your answer

    Manfred
Back to Top