TemplateColumn with multiple parameters

  • Thread starter Thread starter Maziar Aflatoun
  • Start date Start date
M

Maziar Aflatoun

Hi everyone,

I have the following TemplateColumn in a datagrid where I process my data in
another function and return it's result.
<asp:TemplateColumn HeaderText="File" SortExpression="FileName">
<ItemTemplate>
<%# CreateFileHyperlink(DataBinder.Eval(Container.DataItem,
"FileName")) %>
</ItemTemplate>
</asp:TemplateColumn>

public string CreateFileHyperlink(Object FileName)
{
 
Maziar said:
Hi everyone,

I have the following TemplateColumn in a datagrid where I process my
data in another function and return it's result.
<asp:TemplateColumn HeaderText="File" SortExpression="FileName">
<ItemTemplate>
<%# CreateFileHyperlink(DataBinder.Eval(Container.DataItem,
"FileName")) %>
</ItemTemplate>
</asp:TemplateColumn>

public string CreateFileHyperlink(Object FileName)
{
.
.
.
return FileName.ToString();
}

Here I send the field value FileName. Now is it possible to send
multiple fields? such as FileName, FileID...etc? (it's defined in my
table)

Thank you
Maz.

Sure it's possible:
<%# CreateFileHyperlink(DataBinder.Eval(Container.DataItem,
"FileName"),DataBinder.Eval(Container.DataItem,"Target")) %>

And:

public string CreateFileHyperlink(Object FileName,Object Target)
{
 
Back
Top