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

How to provide a link in email to article id.

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
illumination
Top achievements
Rank 2
illumination asked on 26 Jan 2010, 09:56 PM
Need help :)
The scenario: I have a radgrid with popup edit form. When the user able to view the details in the popup by article ID, then I need a button in this edit form that when the user click this button, it will open up outlook new message and create a link to view this specific article ID edit form. When user receive the email and click on the link, they will be able to view the article ID in the popup edit form.

Is this possible or is that a best way to achieve this kind of scenario?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Accepted
Radoslav
Telerik team
answered on 29 Jan 2010, 02:28 PM
Hello Lina,

You could generate the link for each row in the RadGrid by using a grid template column. In the ItemTemplate you could add a HyperLink with NavigateUrl which points to the page where the RadGrid is placed. Also in this NavigateUrl you could add as parameter the ID of the item to which the email will be related:
Copy Code
<telerik:GridTemplateColumn UniqueName="links" DataField = "ID" DefaultInsertValue="" HeaderText="links" SortExpression="ID">
  <ItemTemplate>
      <asp:HyperLink ID="hyperLink" NavigateUrl='<%#"mailto:test@test.com?Subject=subject&Body=Follow this link to edit details: http:\\<your link here>?id=" + Eval("ID")%>' runat="server">Link</asp:HyperLink>
      </ItemTemplate>
</telerik:GridTemplateColumn>

The link which is generated should point to the page with the RadGrid. There you could get the id from the QueryString. Then on the RadGrid's ItemDataBound event handler you could check if the ID is equal to the ID of the element which is currently bound. If they are equal the Edit form is shown:
Copy Code
void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{   
      GridDataItem item = e.Item as GridDataItem;
      if (item != null && Request.QueryString["id"] != null)
      {
          string ID = Request.QueryString["id"].ToString();
          if (item["ID"].Text == ID)
          {
                item.Edit = true;
          }
       }
 }


All the best,
Radoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
illumination
Top achievements
Rank 2
Answers by
Radoslav
Telerik team
Share this question
or