This is a migrated thread and some comments may be shown as answers.

Show small icons in detail view of grid

2 Answers 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
arun
Top achievements
Rank 1
arun asked on 02 Aug 2010, 06:17 AM
Hi all,

I have radgrid, on every row selection, we are showing detail view for that particular row.
In that i am showing some field data i.e COMPANY, STATUS, ADDRESS and ACTION REQUIRED
and now i wanted to show YES or NO type of small icons as per some condition for a ACTION REQUIRED field.

How can i show icons for this scenario.
need sample code for this.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 02 Aug 2010, 10:28 AM
Hello Arun,

One suggestion would be using GridTemplateColumn (in DetailsTable) with Image control and assigning the image in ASPX itself as shown below.

<telerik:GridTemplateColumn UniqueName="TemplateColumn">
      <ItemTemplate
           <asp:Image ID="ImportantImage" BorderWidth="0px" ImageUrl='<%# Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "Status"))? "img/yes.gif" : "img/no.gif" %>' 
                AlternateText="Status" Style="float: right; cursor: pointer;" runat="server"> 
           </asp:Image
      </ItemTemplate
</telerik:GridTemplateColumn>


Also you can perform the same from code behind, in ItemDataBound event. A similar approach is shown in the following forum.
Image in RadGrid programmatic creation


Thanks,
Princy.
0
arun
Top achievements
Rank 1
answered on 04 Aug 2010, 07:30 AM
Hi Princy,

It worked...
Thank You so much !
Tags
Grid
Asked by
arun
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
arun
Top achievements
Rank 1
Share this question
or