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

Images in RadGrid Columns From Db

1 Answer 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 2
Veteran
Roger asked on 24 Nov 2008, 06:13 PM
Hi:

Using the asp:GridView, I have been able to successfully display thumbnail images stored in my database in the GridView Cells.  I have done this using Template Fields and a custom control that fetches the bit stream from the database.  I have been trying to do this using the RadGrid but have been unsuccesful.  Any Suggestions?

Regards,
Roger

<asp:TemplateField HeaderText="Image">
                            <itemtemplate>
                            <asp:Image ID="SmallPic2" runat="server" ImageUrl='<%# "~/Controls/Fetch_Pic.ashx?ProductPicID="+ Eval("PicID") + "&Size=Small"  %>' />
                        </itemtemplate>
                        </asp:TemplateField>

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 25 Nov 2008, 07:29 AM
Hello Roger,

You can use the grid template columns to achieve exactly the same with RadGrid:

<telerik:GridTemplateColumn HeaderText="Image">
 <ItemTemplate>
    <asp:Image ID="SmallPic2" runat="server" ImageUrl='<%# "~/Controls/Fetch_Pic.ashx?ProductPicID="+ Eval("PicID") + "&Size=Small"  %>' />
    </
ItemTemplate>
</
telerik:GridTemplateColumn>

Kind regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Roger
Top achievements
Rank 2
Veteran
Answers by
Vlad
Telerik team
Share this question
or