Hello. I have a method, but I do not wish to pass the
gridvieweventargs parameter. Here's the method:
public virtual void CreateHyperLink(string column, string
destinationUrl, GridViewRowEventArgs e)
{
int columnIdx =0;
if (e.Row.RowType == DataControlRowType.Header)
{
foreach (DataColumn col in ((DataTable)Session
["TaskTable"]).Columns)
{
if (col.ColumnName == column)
{
colVal = columnIdx;
}
columnIdx += 1;
}
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
string value = e.Row.Cells[colVal].Text;
destinationUrl = string.Format("{0}" + "?Id=" +
"{1}", destinationUrl, value);
HyperLink link = new HyperLink();
link.Text = value;
link.NavigateUrl = destinationUrl;
link.Target = "_blank";
e.Row.Cells[colVal].Controls.Add(link);
}
}
I'm not sure how to remove the gridviewevent args parameter w/o
throwing an error. Any assistance would be greatly appreciated. Thanks.