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

user control in list view

5 Answers 131 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Priya
Top achievements
Rank 1
Priya asked on 27 Dec 2010, 02:29 PM
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

5 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 27 Dec 2010, 04:34 PM
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.
0
Priya
Top achievements
Rank 1
answered on 28 Dec 2010, 10:06 AM
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.
0
Priya
Top achievements
Rank 1
answered on 28 Dec 2010, 04:00 PM
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.
0
Priya
Top achievements
Rank 1
answered on 29 Dec 2010, 08:28 AM
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.
0
Iana Tsolova
Telerik team
answered on 30 Dec 2010, 12:01 PM
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.
Tags
ListView
Asked by
Priya
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Priya
Top achievements
Rank 1
Share this question
or