ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2016-03-14 09:40:37

asparatu
Member
Registered: 2014-08-20
Posts: 196

Can you change the celldropdown button?

Hello Jing,
   Is there way to change the celldropdown button? I think maybe onpaint you can change it. I would have to make my own control and change the onpaint for the dropdown button. or can just change the color and make it flat?

Shane

Offline

#2 2016-03-14 14:45:28

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Can you change the celldropdown button?

Hi Shane, you can overwrite the OnPaintDropdownButton method to draw your custom drop-down button, here is an example:

C#:

class MyDropdownListCell : DropdownListCell
{
	protected override void OnPaintDropdownButton(CellDrawingContext dc, unvell.ReoGrid.Graphics.Rectangle buttonRect)
	{
		dc.Graphics.DrawRectangle(Pens.Black, buttonRect);
	}
}

VB.NET:

Class MyDropdownListCell
	Inherits unvell.ReoGrid.CellTypes.DropdownListCell

	Sub New()
		MyBase.New()
	End Sub

	Protected Overrides Sub OnPaintDropdownButton(dc As CellDrawingContext, buttonRect As Rectangle)
		dc.Graphics.DrawRectangle(Pens.Black, buttonRect)
	End Sub

End Class

Last edited by Jingwood (2016-03-14 14:48:23)

Offline

#3 2016-03-15 01:44:01

asparatu
Member
Registered: 2014-08-20
Posts: 196

Re: Can you change the celldropdown button?

Hello Jing,
   Thank you.. I will try that..
Shane

Offline

Board footer

Powered by FluxBB