Get RadDataBoundListBox object from LoadMore button

Thread is closed for posting
2 posts, 0 answers
  1. bento
    bento avatar
    35 posts
    Member since:
    Aug 2013

    Posted 02 Oct 2013 Link to this post


    Do you know how to get "listBound" object from inside "btnLoadMore_Click" method ? Because the sender as Button, have a parent = null.

    <telerikPrimitives:RadDataBoundListBox x:Name="listBound">
                <Button x:Name="btnLoadMore"
                        Tap="btnLoadMore_Click" />

  2. MasterChiefMasterChef
    MasterChiefMasterChef avatar
    152 posts
    Member since:
    Jan 2013

    Posted 02 Oct 2013 Link to this post

    Hi bento,

    You should be able to access the RadDataBoundListBox in the code behind simply by typing its Name property. You can then use the properties and methods of the RadDataBoundListBox object.

    private void btnLoadMore_Click(object sender, RoutedEventArgs e){
           //to access list box in the code behind, simply type its Name property and you will be able to access its properties and methods.
           //ObjectBoundToListBox is the object you are binding to the DataBoundListBox
            var selectedObject = (listBound.SelectedItem as ObjectBoundToListBox);
           //you can now use the ObjectBoundToListBox and its properties and methods.
           int number = selectedObject.CustomProperty;

    If you need to learn how to bind data to a RadDataBoundListBox, take a look at the documentation:

    Good luck,
    Master Chief

Back to Top