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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Button in derived GridTextBoxCellRenderer

Thread ID:

Created:

Updated:

Platform:

Replies:

63201 Jun 29,2007 01:13 PM UTC Jun 29,2007 09:17 PM UTC Windows Forms 1
loading
Tags: GridControl
Marek Solarski
Asked On June 29, 2007 01:13 PM UTC

Hi,

I'd like to derive GridTextBoxCellRenderer and add a button to the cell for my own purposes.

I derived the renderer like this:

public class MyGridTextBoxCellRenderer : GridTextBoxCellRenderer {
public MyGridTextBoxCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
: base(grid, cellModel) {
DropDownPart = new GridDropDownCellImp(this);
DropDownButton = new GridCellButton(this);
}
}

This does not work (Grid shows red cell with 'Exception' text on it). Code works only if I derive after GridDropDownCellRenderer, but I'd like not to have a dropDown. I'd like to have a simple text with button only. How can I achieve this?

Thank you for your help.

Best regards,
Marek S

haneefm [Syncfusion]
Replied On June 29, 2007 09:17 PM UTC

Hi Marek,

The attached sample demonstrates how you can implement a button edit control in grid cells. The ButtonEditCellButton class that is derived from the class GridCellButton, is used to draw buttons in grid cells. Inside this class, the ButtonEditStyleProperties class can be accessed in order to supply the necessary style settings for these button controls. This class will let you create different types of button controls like buttons with images, buttons painted with colors, button faces with text, buttons with borders, etc. It also provides many options like aligning the buttons in grid cells, aligning the text on the button face, etc. You can also enable or disable these button controls. Apart from these classes, this sample also includes a cell model and a cell renderer class which, can be used to create a custom cell type. In addition, this sample also has RTL support for these button edit cells.

Below is a sample.
ButtonEditCells.zip

Best regards,
Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;