Hi NK,
Create a custom control that inherits from ListDisplay. Then override
PageLists_ItemCreated and implement a custom method that will show a single item based on the ID of a single item in the QueryString
sample
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Telerik.Lists.WebControls;
using Telerik.Lists;
using System.Web.UI;
/// <summary>
/// Summary description for ListsDisplayCustom
/// </summary>
public class ListsDisplayCustom :ListDisplay
{
public ListsDisplayCustom()
{
//
// TODO: Add constructor logic here
//
}
protected override void PageLists_ItemCreated(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
if (!String.IsNullOrEmpty(Context.Request.QueryString["item"]))
{
var qs = Context.Request.QueryString["item"];
ShowSingleItem(qs);
}
else
{
base.PageLists_ItemCreated(sender, e);
}
}
public virtual void ShowSingleItem(string id)
{
IListItem listItem = (IListItem)this.Manager.GetListItem(new Guid(id));
if (this.PageListContainer.Headline != null)
{
((Control)this.PageListContainer.Headline).Visible = true;
this.PageListContainer.Headline.Text = listItem.Headline;
}
if (this.PageListContainer.Content != null)
{
((Control)this.PageListContainer.Content).Visible = true;
this.PageListContainer.Content.Text = "" // get the list item content here
}
if (this.PageListContainer.BackToAllItemsButton != null)
((Control)this.PageListContainer.BackToAllItemsButton).Visible = true;
this.PageListContainer.Lists.Visible = false;
}
}
You have to add a ToolboxItem for the control and override PageListTemplatePath to set the path to your template.
Sincerely yours,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items