Working with Gridviews

Posted by Madhuri123 under Regular Expressions on 6/2/2011 | Points: 10 | Views : 1846 | Status : [Member] | Replies : 5
Hi,

I want to display the Name,Desc,Price,Image into Gridview.Name,Desc,price is displaying into the grid view ,but Image is not displaying i write this code but it is not working.
<img id="ImageProduct" src='<%# DataBinder.Eval(Container.DataItem,"Image1","Browse/Images/{0}")%>' alt ="Image Unavailable" runat="server" />

Please any one help me

Thanks InAdvance,
T.Madhuri




Responses

Posted by: Nithadeepak on: 6/2/2011 [Member] Bronze | Points: 25
Posted by: Susanthampy on: 6/2/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi.

Refer this link,

http://msdn.microsoft.com/en-us/library/aa479350.aspx

Regards,
Susan

Madhuri123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jsathish06 on: 6/2/2011 [Member] Starter | Points: 25

Up
0
Down
grid view is display table format, we using edit, sort

Madhuri123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 6/2/2011 [Member] Starter | Points: 25

Up
0
Down
Hi
in the expression
<img id="ImageProduct" src='<%# DataBinder.Eval(Container.DataItem,"Image1
","Browse/Images/{0}")%>' alt ="Image Unavailable" runat="server" />

Highligghted text should be the Column Name of the image field if you are binding a datatable or it should be the Property name that stores the name of image incase you are binding a collection of a particular class to gridview.

*Pls make sure that "Browse/Images" this is the directory where you store all these images, else specify the correct folder path.

Thanks,
Debata

Madhuri123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakn2 on: 6/3/2011 [Member] Starter | Points: 25

Up
0
Down
try this

http://www.codeproject.com/KB/aspnet/GridImage.aspx

Thanks&Regards
LakshmiNarayana Nalluri.

Madhuri123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response