Thanks for your suggestion.So you meant to say that the below code will
work assuming that i declared linkbutton in the datagrid control:
protected void grdMinSearch_ItemDataBound(object sender,
DataGridItemEventArgs
e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
LinkButton btn = e.Item.FindControl("linkView") as
LinkButton;
Minute Min=new Minute();
e.Item.Attributes["onclick"] =
Min.GetMinuteOrderPdf(SearchParams sp);
btn.Style[HtmlTextWriterStyle.Display] = "none";
}
}
Please comment on this.
Thanks,
Vishnu
David Colliver wrote:
You can't do it from a hyperlink column as that does not create the event. If
you MUST use a hyperlink column, then call a new page (or pass a querystring
parameter to this page) and call the function from that.
You would normally use a linkbutton or button to cause an event, then in
that event, generate your PDF.
Hope this helps.
Regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Portal franchises available
"se****@gmail.com" wrote:
Hi,
Please help me how can i call the below function on click of datagrid
hyperlink column.
public MemoryStream GetMinuteOrderPdf(SearchParams sp)
{
DMS dms = new DMS();
sp.IsMinuteOrder = true;
return dms.getDocument(sp);//it returns the PDF memory stream
}
ASPX code:
<asp:TemplateColumn HeaderText="Minute Order" >
<ItemTemplate>
<asp:HyperLink
NavigateUrl=<%#GetMinuteOrderPdf(DataBinder.Eval(C ontainer.DataItem,"Minute
Order"))%</asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
Please help me how can i call this function.Is there any way to do
this?
Thanks,
Vishnu