We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Positioning Image in merged cells in databound grid control

When i add an image in a merged cell in databoundgrid control ,the image comes in the middile of the merged cell.Is it possible to bring the images in top and left side of that merged cell?

8 Replies

Administrator February 7, 2005 12:30 PM UTC

How are you adding the image? If you draw it yourself in CellDrawn, then you can draw it anywhere you want. See this thread for some code snippets. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=16748 If you are using a Static or TextBox, and setting GridBoundColumn.StyleInfo.ImageIndex/ImageList, then the default behavior is to align the image to the left.

SU subair February 8, 2005 09:15 AM UTC

I am adding the image in the prepareviewstyle event of databoundgrid by setting imageindex of the cell from imagelist. since the column is merged image is coming in the center of the merged cells.I want to show the image in top left of the merged cell.Is it possible?if it is tpossible where from i ll get the sample code? pls reply immediately >How are you adding the image? > >If you draw it yourself in CellDrawn, then you can draw it anywhere you want. See this thread for some code snippets. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=16748 > >If you are using a Static or TextBox, and setting GridBoundColumn.StyleInfo.ImageIndex/ImageList, then the default behavior is to align the image to the left. >

Administrator February 8, 2005 10:22 AM UTC

Did you try using the CellDrawn event as was suggested yesterday? It seems to work for me. http://www.syncfusion.com/forums/Uploads/GDBG_ImageTL.zip

SU subair February 8, 2005 12:05 PM UTC

I tried the above method.But image is not coming in the top left for the merged cell.Here i am using the merging rows in column. But for merged cell i am not able to find the top side for placing the image.Is there any way to place in the top side of merged cell?

Administrator February 8, 2005 12:33 PM UTC

Does the sample work for you? Can you upload a sample project that does not work?

SU subair February 8, 2005 02:07 PM UTC

Hi, I had attached one picture of the grid.In this image is coming in the center of the merged cell. I want to put this image in the top left of the merged cell.I used the cell draw event of grid.But i am not able to find the top side of the merged grid.is it possible to put the image in the top of the merged cell?Pleas reply soon

Administrator February 8, 2005 03:58 PM UTC

The sample draws a picture at the top-left corner of the merged cells. In the sample, the CellDrawn event is only raised for the merged cells. (It is not raised for the cells that are not shown). The sample shows how to get the top left rectangle where you would want to draw the image in the top-left corner of the merged cell. Does this code to find the top-left corner not work for you?

SU subair February 9, 2005 05:18 AM UTC

Thanks very much ,Thats working
Loader.
Live Chat Icon For mobile
Up arrow icon