More in this section

Forums / Developing with Sitefinity / Get Thread Id from gridview on page load

Get Thread Id from gridview on page load

4 posts, 0 answered
  1. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    12 Jul 2010
    Link to this post
    Hi

    I need to sort the grid according to author and user.
    for that i need the Thread ID on the page load from the grid view.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    12 Jul 2010
    Link to this post
    Hello asit pani,

    You could get the ID from the QueryString

    if (!String.IsNullOrEmpty(HttpContext.Current.Request.QueryString["thread"]))
    {
     // do something
     
    }


    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
  3. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    12 Jul 2010
    Link to this post
    Hi Ivan,

    Thanks for the reply.

    But I need the thread id in the singleForum page.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    12 Jul 2010
    Link to this post
    Hi asit pani,

    Inside Sitefinity\ControlTemplates\Forums\SingleForum.ascx subscribe for allThreads.RowCreated and get the id from the DataRow

    void allThreads_RowCreated(object sender, GridViewRowEventArgs e)
       {
           if (e.Row.RowType == DataControlRowType.DataRow)
           {
               var id = ((Telerik.Forums.Data.Post)(e.Row.DataItem)).ID;
           
           }
       }


    All the best,
    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
Register for webinar
4 posts, 0 answered