Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
379
Display image on the corner of a cell in WebGrid.
posted

Hi!

    We have a requirement wherein we need to introduce an image in a WebGrid at the bottom right corner of the cell. We were able to put in an image inside a cell through the following code on InitializeRow event:

e.Row.Cells(Index - 1).Value = e.Row.Cells(Index - 1).Text & "<img src='fn.gif' onclick=" & """" & "ShowComments();" & """" & ">"

The webgrid cell is editable.. so now what happens is that the image does appear in the cell but as the cell is editable, as soon as the cell is double clicked the cell appears in edit mode on the image source appears in the cell alongwith the text like this :

24 <img src='fn.gif' onclick="ShowComments();"

Also, when the new value is entered the image gets lost.

Can you please suggest to get an image inside the cell in some other way? Please suggest a solution ASAP as its an urgent requirement.

Thanks
Anuj