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.

DropDownGrid DropdownButton

Thread ID:

Created:

Updated:

Platform:

Replies:

28860 May 11,2005 04:16 PM May 12,2005 10:51 AM Windows Forms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On May 11, 2005 04:16 PM

Hi, I have a 10 column grid and one of those columns expands to a dropdown grid when clicked. I wanted to change the cell type to a pushbutton instead of a combo box. So in the DropDownGridCellRenderer constructor I added the following lines: DropDownButton = new GridCellButton(this); this.DropDownButton.Text = "Edit"; and set the button size by setting the property ButtonBarSize in the CellModel Constructor. My questions are: 1. I see the button only when I click on the cell in the parent grid. I want the button to be seen for that cell in all the rows in the grid. How do I achieve that? 2. I want the button to fill up the entire cell, how do I determine the values to pass to ButtonBarSize so that the button takes up the entire cell? Thanks,

Administrator [Syncfusion]
Replied On May 11, 2005 06:15 PM

Try adding this Draw override to the Renderer class. It handled both th eproblmes you mentioned for me in our sample.
public override void Draw(Graphics g, Rectangle cellRectangle, int rowIndex, int colIndex, GridStyleInfo style)
{
	this.Model.ButtonBarSize =  new Size(this.Grid.Model.ColWidths[ColIndex]-4, this.Grid.Model.RowHeights[RowIndex]-4);

	base.Draw (g, cellRectangle, rowIndex, colIndex, style);
}

Administrator [Syncfusion]
Replied On May 11, 2005 07:00 PM

Clay, Thanks for your response. Your suggestion solved problem 2, however I still see problem 1. To explain the problem a little better, here is what is happening. Say I have 5 rows in the parent grid (and 10 columns). Initially, none of the rows in the grid have the dropdown button visible. When I click on the cell of a row, the button becomes visible only for that row and disappears again when I click another row. WHat I want to achieve is the button should be visible all all times on all rows of the parent grid and one click should bring up the dropdown grid. Thanks for your help, >Try adding this Draw override to the Renderer class. It handled both th eproblmes you mentioned for me in our sample. > >
>public override void Draw(Graphics g, Rectangle cellRectangle, int rowIndex, int colIndex, GridStyleInfo style)
>{
>	this.Model.ButtonBarSize =  new Size(this.Grid.Model.ColWidths[ColIndex]-4, this.Grid.Model.RowHeights[RowIndex]-4);
>
>	base.Draw (g, cellRectangle, rowIndex, colIndex, style);
>}
>

Administrator [Syncfusion]
Replied On May 11, 2005 09:58 PM

Do you have any style setting for style.ShowButtons? Can you upload a sample project showing the problem, or can you tell us how to see it in our sample?

Administrator [Syncfusion]
Replied On May 12, 2005 10:51 AM

Clay, I had already set the property style.ShowButtons to "Show". I changed it back to "None", did a rebuild, and then changed it back to "Show" and rebuilt again and now the buttons show up fine. Thanks a lot, >Do you have any style setting for style.ShowButtons? > >Can you upload a sample project showing the problem, or can you tell us how to see it in our sample?

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.

;