Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to display image in gridview whose path stored in database
Posted

take image control in grid view assign the imageurl property like this

XML
<asp:GridView ID="GridView1" runat="server" >
           <Columns>
               <asp:TemplateField>
                   <ItemTemplate>
                   <asp:Image ID="img1" runat="server" ImageUrl='<%#Eval("Image path") %>' />
                   </ItemTemplate>
               </asp:TemplateField>
           </Columns>
       </asp:GridView>
 
Share this answer
 
v2
try this nice article
Gridview image
 
Share this answer
 
is it windowBased or webbased(ASP.NET) ?
conside it is winform. here is solution.

1. Add a DataGridViewImageColumn in DataGridView.
2. Set the Image property of the column to image u want.
3. Handle the RowsAdded event of the DataGridView and add the following code in the event handler:

C#
void dataGridView1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
{
    this.dataGridView1.Rows[e.RowIndex-1].Cells[0].Value = null;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900