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.

GridDataBoundRowExpandCellButton

Thread ID:

Created:

Updated:

Platform:

Replies:

33706 Aug 24,2005 11:10 AM Aug 25,2005 08:48 AM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 24, 2005 11:10 AM

Hello, I''m trying to replace view of Expand cell button of GridDataBoundGrid with my own images for collapsed/expanded states. I created my own ExpandCellModel (descendant of GridDataBoundRowExpandCellModel) which uses ExpandCellRenderer (descendant of GridDataBoundRowExpandCellRenderer) that again uses ExpandButton( descendant of GridDataBoundRowExpandCellButton). In ExpandButton class method Draw is overrided: public override void Draw(Graphics g, int rowIndex, int colIndex, bool bActive, GridStyleInfo style) { Bitmap image = expanded ? _expanded :_collapsed; g.DrawImage(image, Bounds.Left, Bounds.Top); } added in constructor of the grid this.Model.CellModels.Add("ExpandCellModel", new CustomGridCell.ExpandCellModel(this.Model)); and in handler of GridDataBoundGrid.PrepareViewStyleInfo for cell with appropriate number of column e.Style.CellType = "ExpandCellModel"; but method ExpandButton.Draw is never executed, and expand button stays same, no my images are presented. Can you suggest something? Thank you

Administrator [Syncfusion]
Replied On August 24, 2005 12:36 PM

In the constructor of your renderer class, I think you will have to remove the button (there is a protected renderer.RemoveButton method) that was added in the base class constructor and then add an instance of your own button. I suspect it is this baseclass button still being used is the reason you do not see your code being hit.

Administrator [Syncfusion]
Replied On August 25, 2005 08:48 AM

Yes, that is working, thank you very much. I''ve also discovered that button remembers it state only when current cell is avctive: I used functions IsPushed and IsMouseDown to determine state of the button in the Draw method. As I see own Expand buttons of GridDataBoundGrid remembers their state - they store it in GridStyleInfo.CellValue. So now I do the same - and my custom Expand button works good. Thank you again.

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.

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.

;