+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / how to get Id of a thread in admin panel?

how to get Id of a thread in admin panel?

2 posts, 1 answered
  1. Thavarajah
    Thavarajah avatar
    48 posts
    Registered:
    15 Oct 2010
    24 Nov 2010
    Link to this post
    Hi Team;

    I am trying to customize forum's admin panel(http://mybiz-dev.singtel.com/sitefinity/Admin/Modules.aspx?module=Forums) for our needs and i need to selected threadId when 'ControlPanelViewThreadTemplate.ascx' loads.

    Is there any do it with the provided template?

    Regards,
    Vimal
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Nov 2010
    Link to this post
    Hello Thavarajah,

    You can subscribe for allposts.ItemDataBound event

    public void Page_Load(object sender, EventArgs e)
    {
      
        this.allPosts.ItemDataBound += new RepeaterItemEventHandler(allPosts_ItemDataBound);
    }
      
    void allPosts_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
        {
            Telerik.Forums.IPost post = (Telerik.Forums.IPost)e.Item.DataItem;
            if (post != null)
            {
                var postId = post.ID;
                // get the IP from your custom table and depending on the post ID
                // show the data with label.
            }
        }
    }

    You can gather more information from this post.

    Kind regards,
    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
    Answered
2 posts, 1 answered