user control in list view

6 posts, 0 answers
  1. Priya
    Priya avatar
    14 posts
    Member since:
    Sep 2010

    Posted 27 Dec 2010 Link to this post

    Hi Telerik,

    I want to use a list view control with an user control as its data item. I want to add user control and bind to the list view each time a button is clicked. I also want paging for the list view. Please reply me asap.

    Thanks in advance
  2. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 27 Dec 2010 Link to this post

    Hi Priya,

    Have you try placing a declaration of the user control in the RadListView ItemTemplate? Then on button click, try rebind the listview by calling its Rebind() method.

    Best wishes,
    Iana
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Priya
    Priya avatar
    14 posts
    Member since:
    Sep 2010

    Posted 28 Dec 2010 Link to this post

    Thanks for your reply Lana. Now i am able to bind the user control to the list view. But am not able to get paging work. I am binding the list view on button click and i do not have the Need data Source event. I want to get paging work.I went through the demos. Can you post sample code.
  5. Priya
    Priya avatar
    14 posts
    Member since:
    Sep 2010

    Posted 28 Dec 2010 Link to this post

    Also am not able to set the page size for the list view. even if i set the page size as 6, more than 6 user controls are being added to the same page.
  6. Priya
    Priya avatar
    14 posts
    Member since:
    Sep 2010

    Posted 29 Dec 2010 Link to this post

    I was adding the user control to the controls collection and so paging is not working i guess. I want to add the user controls dynamically to the items collection of listview on button click. Please reply asap. If i adda static user control everything is working fine.
  7. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 30 Dec 2010 Link to this post

    Hi Priya,

    If you want to add the user controls dynamically, then place a PlaceHolder control in the ItemTemplate of the RadListView. Then handle the ItemCreated event of the RadListView. There if the "e.Item" is RadListViewDataItem, find the PlaceHolder by its ID, e.g. using the FindControl method and load the user control in it.

    For more information on accessing controls in RadListView, check this article.

    Greetings,
    Iana
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017