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

Buttons

How do we create buttons that appear as images in cells? I''m trying to set an image to a button and then set the button to a cell. Thanks in advance.

7 Replies

AD Administrator Syncfusion Team July 21, 2004 12:51 PM

Take a look at the Grid\Samples\In Depth\CellButtons sample. It has an ellipsis celltype that shows a bitmap button. There is a common namespace problem when users try to use this celltype. Here is a forum thread with the point to look out for. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=15521


EM Eddie Molieri July 21, 2004 01:31 PM

This is the image that I would like to display on the button; I tried changing string bitmapName = "Browse.bmp"; to string bitmapName = "Submit.bmp";. It doesn''t display the image though... >Take a look at the Grid\Samples\In Depth\CellButtons sample. It has an ellipsis celltype that shows a bitmap button. > >There is a common namespace problem when users try to use this celltype. Here is a forum thread with the point to look out for. >http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=15521 Submit_8168.zip


AD Administrator Syncfusion Team July 21, 2004 01:51 PM

Did you include Submit.bmp as embedded resource in your project like the browse.bmp was inlcuded in the sample project?


EM Eddie Molieri July 21, 2004 01:53 PM

yes I did. >Did you include Submit.bmp as embedded resource in your project like the browse.bmp was inlcuded in the sample project?


AD Administrator Syncfusion Team July 21, 2004 02:13 PM

That is all I had to do to get your bitmap to show up, change the file name and include teh file as an embedded resource. But your bitmap is a lot bigger than the bitmap you are replacing, so to fully see it, you also have to adjust the button sizes in the code. Here is the sample. CS_9698.zip


EM Eddie Molieri July 21, 2004 02:20 PM

is there a way to change the color of the button? >That is all I had to do to get your bitmap to show up, change the file name and include teh file as an embedded resource. But your bitmap is a lot bigger than the bitmap you are replacing, so to fully see it, you also have to adjust the button sizes in the code. Here is the sample. > >CS_9698.zip > >


AD Administrator Syncfusion Team July 21, 2004 02:32 PM

There is no property that does this. The EllipsisCellButton.Draw method calls DrawButton to actually draw the button. This method calls ControlPaint.DrawButton to do the button drawing and this FrmaeWork class does not have any color options. So, if you want ot have a different color, in the EllipsisCellButton.Draw method, instead of calling DrawButton to draw things, you would have to draw the button yourself using the colors you want. Another option would be to have the bitmap reflect the color your want to see and size the button to be exactly the size of the bitmap.

Loader.
Live Chat Icon For mobile
Up arrow icon