Hello,
I'm really having too much troubles using RadListView. Now I'll try to briefly explain.
The project that I started to work on is a very specialized search engine using a complex data layer that can use one or more databases simultaneously. So I thought that was a good idea to use a RadListView with RadDataPager for a flexible paging.
Initially I was using the ASP.Net Controls version 2009.3.1103. Soon I realized that something was not going on as I expected: in fact, starting with no Data Source specified, after a postback initiated by another control, the data was not shown and the "no data template" was always presented. After a long search, finally I found a post in this forum that pointed me to this known bug.
Well, I did update the controls and the bug disappeared. But, unfortunately, now I'm stuck on the programmatic creation of the control. In fact I discovered that in design-time it is not possible to configure the RadListView via "smart tag option" since a valid data source is not specified.
A search engine cannot perform any query in a first page load, so I need to do all the data source job (dinamic query creation in response of the user parameter input) in a "if Page.IsPostBack then [...] End If" code block.
That's why I passed to the programmatic creation of the control.
Now, and this is the main problem to solve, it seems that there is no way to avoid this error message:
The RadListView control does not have an item placeholder specified.
For more clarity, this is the code-snippet in which I "try" to create the RadListView:
Private rlvResults As RadListView |
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init |
Me.BuildListView() |
End Sub |
Protected Sub BuildListView() |
Me.rlvResults = New RadListView() |
With Me.rlvResults |
.AllowCustomPaging = False |
.AllowCustomSorting = False |
.AlternatingItemTemplate = New GooWayTemplates.AlternatingItemTemplate() |
.EditItemTemplate = New GooWayTemplates.EditItemTemplate() |
.InsertItemTemplate = New GooWayTemplates.EditItemTemplate() |
.ItemTemplate = New GooWayTemplates.ItemTemplate() |
.EmptyDataTemplate = New GooWayTemplates.EmptyDataTemplate() |
.LayoutTemplate = New GooWayTemplates.LayoutTemplate() |
.SelectedItemTemplate = New GooWayTemplates.ItemTemplate() |
.ItemPlaceholderID = "itemPlaceholder" |
AddHandler .NeedDataSource, AddressOf rlvResults_NeedDataSource |
.AllowPaging = True |
End With |
Me.placeHListView.Controls.Add(Me.rlvResults) |
End Sub |
Where am I wrong?
This is a fundamental step in a big project and I'm really confused :-)
Thanks in advance.