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-16 06:04:59

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

Custom RadioButtonCell

Hello Jing,
   I ask you this question before and I have not got chance add to my project until today. I was looking at the sample code you gave me in Post #118 and the code does not work because some of the methods are not in control.

Error Message are:
'ButtonState' is not a member of 'unvell.ReoGrid.CellTypes.RadioButtonCell'.
'DrawImageUnscaled' is not a member of 'unvell.ReoGrid.Graphics.IGraphics'.

Imports unvell.ReoGrid
Imports unvell.ReoGrid.Rendering
Imports unvell.ReoGrid.CellTypes

Class ImageRadioButtonCell
    Inherits RadioButtonCell

    Public Overrides Sub OnPaint(dc As CellDrawingContext)
        If MyBase.ButtonState = Windows.Forms.ButtonState.Checked Then
            dc.Graphics.DrawImageUnscaled(My.Resources.RadioButton_NoBG_Selected, MyBase.Bounds.Location)
        Else
            dc.Graphics.DrawImageUnscaled(My.Resources.RadioButton_NoBG_Unselected, MyBase.Bounds.Location)
        End If
    End Sub
End Class

Shane

Last edited by asparatu (2016-03-16 06:05:57)

Offline

#2 2016-03-16 15:03:04

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

Re: Custom RadioButtonCell

The RadioButtonCell class has been changed in latest version, try use the below code.

VB.NET:

Class ImageRadioButtonCell
	Inherits unvell.ReoGrid.CellTypes.RadioButtonCell

	Protected Overrides Sub OnContentPaint(dc As CellDrawingContext)
		If MyBase.IsChecked Then
			dc.Graphics.DrawImage(My.Resources.RadioButton_NoBG_Selected, MyBase.ContentBounds)
		Else
			dc.Graphics.DrawImage(My.Resources.RadioButton_NoBG_Unselected, MyBase.ContentBounds)
		End If
	End Sub

End Class

Last edited by Jingwood (2016-03-16 15:03:23)

Offline

#3 2016-03-17 01:12:52

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

Re: Custom RadioButtonCell

Hello Jing,
   Thank you, i will try that
Shane

Offline

Board footer

Powered by FluxBB