TemplateColumn with multiple parameters

  • Thread starter Maziar Aflatoun
  • 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)
{
 
J

Jos

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)
{
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top