Skip to content
Loading
 
0
  • 0
    Dear Laxmidhar Sahoo,
     
    I have changed the cell number and still I not able to recognize that particular column.
     
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
    DataRowView dr = (DataRowView)e.Row.DataItem;
    string headerText = e.Row.Cells[5].Text;
    if (headerText == "View Image")
    {
    string imageUrl = "data:image/jpg;base64," + Convert.ToBase64String((byte[])dr["Image"]);
    (e.Row.FindControl("Image1") as System.Web.UI.WebControls.Image).ImageUrl = imageUrl;
    }
    }
    0
  • Laxmidhar Sahoo
    0
    perhaps you do not define the cell named Image1
     
    (e.Row.FindControl("Image1") as System.Web.UI.WebControls.Image).ImageUrl = imageUrl;
    0
  • 0
    Dear Laxmidhar Sahoo,
     
    When I debug the code, line string headerText = e.Row.Cells[5].Text; always is NULL and the breakpoint not going inside the if condition
     
    if (headerText == "View Image")
    {
    }
    0
  • Laxmidhar Sahoo
    0
    without if condition check.I mean comment the if condition and look what happens
    0
  • 0
    Dear All,
     
    Now I changed the image path. before I used to insert image directly into table. Now I saving image into a file path and the same path will save into table.
     
    This is how my table values storing now:-

     
     
    And when I binding the filepath value into the gridview link button, I getting like this.
     
    Please note my requirment:-
     
    1. grid has to display icon only if there is a associated image for the particular action.( which I achieved by binding) .
     
    You can see action with blank in image column.
     
    2) The link button in view Image column doing the important activities like open boostrap modal  and modal fetching row Id based images, comment etc..
     
     If I remove code Text='<%#Bind("Filepath")%>'from the Link button , all row column will display with the icon.
     
    Is there any way to eliminate/replace the binding text?
     
    I want to eliminate the text below '\\403-PC\Save Path\..  and to display icon displaying in the back.
     

     
    0
  • 0
    Dear All,
     
    This is to inform that the issue has been solved by c# code. Thank you all for the support.
     
     aspx. code
     

     
    And c# code:- 
     

     
    0