Visualization in ComponentArt GridView

L

Luigi

Hi all,
I have a GridView ComponentArt that must shows a paper clip when a record
has an attachment (the query returns an Id if exists, and 0 if does not
exists).
My actual code is this one:

<ComponentArt:GridServerTemplate ID="AttachmentTemplate" runat="server">
<template>
<cc1:LinkButton runat="server" ID="btnAttachment"
CommandName="ShowAttachment" CommandArgument='<%#
Container.DataItem["AttachId"] %>'>
<img src="images/graffetta.gif" title="Attachment" alt="Attachment"
border="0" /></cc1:LinkButton>
</template>
</ComponentArt:GridServerTemplate>

and:

<ComponentArt:GridColumn AllowSorting="False" DataField="AttachId"
HeadingText="Attachment" Align="center"
DataCellServerTemplateId="AttachmentTemplate" Width="80" />

but it always shows the paper clip, also if there is none attachment.
How can I adjust this problem?

Thanks in advance.

Luigi
 
L

Luigi

I'm trying this code in the grdResults_ItemDataBound method:

Image img = (Image)AttachmentTemplate.FindControl("imgGraffetta");

with this in .aspx page:

<ComponentArt:GridServerTemplate ID="AttachmentTemplate" runat="server">
<template>
<cc1:LinkButton runat="server" ID="btnAttachment"
CommandName="ShowAttachment" CommandArgument='<%#
Container.DataItem["AttachId"] %>'>

<asp:Image ID="imgGraffetta" runat="server"
ImageUrl="~/images/graffetta.gif" AlternateText="" />

</cc1:LinkButton>
</template>
</ComponentArt:GridServerTemplate>

but the variable "img" return null, like if there are not controls inside
the GridServerTemplate.

What's the problem?
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top