Let's imagine that you are using a WebHierarchicalDataGrid with a templated column that you wish to show up an envelope icon such that when you click on it, it launches the mailer with an email message to the person named in that row of the grid.
I'm picturing that I need to handle an event in the grid in the code behind to make this happen, but it is not coming to light which one that would be.
I am used to the UltraWebGrid, and the API for this new grid is totally different for some reason.
Here was an attempt to do this in markup; The title part of this markup works fine. It is the email link I am struggling with. Any ideas?
<ig:TemplateDataField Key="TemplateField_0"> <Header Text="TemplateField_0" /> <ItemTemplate> <%-- <a href="mailto:Cheryl.Amey@WestonSolutions.com">--%> <div style="text-align: center;"> <a href='mailto:' + '<%# DataBinder.Eval(DirectCast(Container, Infragistics.Web.UI.TemplateContainer).DataItem, "Email") %>' > <img src="~/images/mail.gif" title="<%# Eval("Email")%>" border="0" alt="" /> </a> </div> </ItemTemplate> </ig:TemplateDataField>
Hi Alan,
I am unclear on the part you need assistance with. Is it the link button firing to launch a mailer, or is it the populating of the mailer from the selected row of the WHDG? If you can help me with this I will have a better understanding of how to proceed.
In the interim, you can reference this cheat sheet which has been very helpful for those migrating from the UltraWebGrid to the WebHierarchicalDataGrid.
Please let me know how I can be of further assistance.
http://help.infragistics.com/NetAdvantage/ASPNET/2011.1/CLR4.0/?page=WebHierarchicalDataGrid_Cheat_Sheet.html
Please let me know if you need any additional assistance regarding this matter.
FYI, I have found this approach as best practice for templating out an email address in your WebData grids:
<ig:TemplateDataField Key="Template1" Width="30%"> <ItemTemplate> <a href='mailto:<%# DataBinder.Eval(DirectCast(Container,Infragistics.Web.UI.TemplateContainer).DataItem, "Email_Addr") %>'> <%# DataBinder.Eval(DirectCast(Container,Infragistics.Web.UI.TemplateContainer).DataItem, "Email_Addr") %> </a> </ItemTemplate> <Header Text="Email Address" /></ig:TemplateDataField>
Troy,
Alan (my co-worker) asked me to reply to this and let you know that he will be away for a few more days yet and will reply when he returns.
Thanks,
John