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

load the image into the grid

1 Answer 2046 Views
Grid
This is a migrated thread and some comments may be shown as answers.
charan
Top achievements
Rank 1
charan asked on 05 Jun 2012, 01:26 PM
hi,
I have a column named Image in my database.i am able to load all the fields in the database including image also,but I am getting only one image in all the rows and that image is related to the mentioned ID in the query.
my code is:
public ActionResult GetImage()
        {
            var imgquery = (from img in dbContext.Personaldetails where img.ID == 1
 
                            select new 
                            {
                                Image = img.Image
                            }).FirstOrDefault();
            {
                System.IO.MemoryStream outStream = new System.IO.MemoryStream();
                byte[] Image = imgquery.Image;
                return File(Image, "Image/jpg");
            }
        }
In the view,i retrieved by using
<img src="@Url.Action("GetImage", "Home")"  alt = "image" />
 
now, i want to display specific images with specific ID value.

	 

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 05 Jun 2012, 01:49 PM
Hello Charan,

This issue is not directly related to the Grid, as it is a matter of implementing a suitable datasource. Please take a look at the following demo:

http://demos.kendoui.com/web/grid/rowtemplate.html

You can also use a single column template, instead or a row template.

In addition, please avoid posting multiple closely-related forum threads on the same topic, as it makes tracking your support history difficult and may lead to overhead. Thank you for understanding.

Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
charan
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or