Binding RadListBoxItem

2 posts, 0 answers
  1. David
    David  avatar
    35 posts
    Member since:
    Dec 2008

    Posted 18 Jan 2010 Link to this post

    Hi all,

      I am trying to do a drag and drop shopping cart very similiar to the  I am using Item Templates with a style override of list tag to display inline creating a horizatal layout of products.  

      Currently I am pulling my data of products in using LingtoSql then binding the data with this:
     var db = new Products.ProductsDataContext();  
            var floorthumbs = (from c in db.Floorings  
                               select c);  
            RadListBox1.DataSource = skus;  

      I  tried using <img class="product-image" src='Images/<%# DataBinder.Eval(Container, "Value")%>' /> to bind the image tag.  I ended up dropping DataBinder.Eval to use just Eval to get image to display.

    When I attempt to transfer an item from the Product list to the Detail View & Purchase, the RadListBox2 does not bind the image name. 

    What is the best method to duplicate the example with pulling in live data from a database?
    Is it possible to load to the RadListBoxItem dynamiclly in the code behind?

  2. Genady Sergeev
    Genady Sergeev avatar
    1595 posts

    Posted 19 Jan 2010 Link to this post

    Hi David ,

    You need to call the DataBind method of the destination listbox whenever an item is transferred. I suggest that you hook on the OnTransferred server side event and call the destination listbox databind method there. Example code:

    protected void Page_Load(object sender, EventArgs e)
           RadListBox1.Transferred += new RadListBoxTransferredEventHandler(RadListBox1_Transferred);
       void RadListBox1_Transferred(object sender, RadListBoxTransferredEventArgs e)

    Sincerely yours,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft R3 2016 release webinar banner
Back to Top