Custom sub editor with C1InputPanel Weirdness

Posted by: kbj on 13 December 2020, 8:09 am EST

    • Post Options:
    • Link

    Posted 13 December 2020, 8:09 am EST - Updated 30 September 2022, 4:12 am EST

    Custom sub editor with C1InputPanel Weirdness

    I am using a custom sub editor for a TextCellType to pop up an input panel with a number of detail values that don’t need to be in a column on a worksheet. The C1InputPanel C1InputRadioButton set on the first time the sub editor drop down is the radio button forced to be selected on all subsequent drop downs, even if the checked property for a different is set to true. Note the the standard radio button control changes depending on which item is current.

    This is the the first drop down where the index value is 1

    Note: that the standard radio button changes correctly:

    This project:


  • Posted 14 December 2020, 6:55 am EST

    Hello Kingman,

    Using the code from your application, I see the same behavior with C1InputRadioButton and standard Radio button.

    Also, checking your code, it seems to be correct behavior as irrespective of the value selected in editor, ucSubEditor_requestWsItem event handler passes the same combination of values from “l” list to “item”. Using that value the components in editor will always have same combination.

    If I am missing anything, you’re requested to please explain. Also, share a video of the problem along the Spread.NET and C1 version you are using.


  • Posted 15 December 2020, 12:31 am EST

    Hi Ruchir,

    In the included example:

    1. When the sub editor is “opened” while the sheet current row is the second row (row 1) the SetValue requests and receives the current row’s item by raising the the requestWsItem event.
    2. The itbNote.Text property is loaded with the item.note “Note 2” value. The irb1 (InputRadioButton) and the rb1 (RadioButton) are checked since the item.Index is 1.
    3. The user moves to the third row on the sheet and clicks the down arrow on the second column and receives the current row’s item by raising the the requestWsItem event. open the sub editor.
    4. The itbNote.Text property is loaded with the correct item.note “Note 3” value. The irb2 (InputRadioButton) and the rb2 (RadioButton) are checked since the item.Index is 2. When the subeditor is displayed, irb2 is NOT the checked radio button.

    If you replace the code in ucSubEditor with:

    Imports C1.Win.C1InputPanel
    Imports FarPoint.Win.Spread.CellType
    Public Class ucSubEditor
        Implements ISubEditor
        Public Property item As classItem
        Public Event ValueChanged As EventHandler Implements ISubEditor.ValueChanged
        Public Event CloseUp As EventHandler Implements ISubEditor.CloseUp
        Public Event requestWsItem As EventHandler(Of classItem)
    #Region "iSubEditor"
        Public Sub SetValue(value As Object) Implements ISubEditor.SetValue
            RaiseEvent requestWsItem(Me, item)
            itbNote.Text = item.note
            Console.WriteLine("item.index:{0}", item.index)
            Select Case item.index
                Case 0
                    irb0.Checked = True
                    rb0.Checked = True
                Case 1
                    irb1.Checked = True
                    rb1.Checked = True
                Case 2
                    irb2.Checked = True
                    rb2.Checked = True
            End Select
        End Sub
        Private Sub irb_CheckedChanged(sender As Object, e As EventArgs) Handles irb0.CheckedChanged,
            Dim irb = CType(sender, InputRadioButton)
            Console.WriteLine("irb{0} checked:{1}", irb.Name, irb.Checked)
        End Sub
        Public Function GetValue() As Object Implements ISubEditor.GetValue
            item.index = irb0.SelectedIndex
            item.note = itbNote.Text
            Return Nothing
        End Function
        Public Function GetSubEditorControl() As Control Implements ISubEditor.GetSubEditorControl
            Return Me
        End Function
        Public Function _GetPreferredSize() As Size Implements ISubEditor.GetPreferredSize
            Return New Size(240, 300)
        End Function
        Public Function GetLocation(rect As Rectangle) As Point Implements ISubEditor.GetLocation
        End Function
    #End Region
    End Class

    . . . you will notice that irb1 is getting checked (I don’t know why and by what) after irb2 is checked programmatically.

    In the example, the RadioButtons are behaving correctly, the InputRadioButtons are not.


    I am using the latest versions of Spread (14.45.20201.0) and C1 (4.5.2)

  • Posted 15 December 2020, 10:18 pm EST


    I got the concern now and can also observe the same at my end. So, I am discussing it with the team (ID: 14247) and will get back to you as soon as we receive some information.



  • Posted 22 January 2021, 6:31 am EST

    Hi Ruchir,

    Any update?


  • Posted 24 January 2021, 6:49 pm EST


    The issue is not with Spread but with InputPanel. We’re discussing this with the C1 team [C1WIN-24220], and let you know once we get some information on this.



  • Posted 11 March 2021, 7:29 pm EST


    As per the developers, it’s not a bug, you should raise the ValueChanged event that updates the value in the sheet.

    Please button to ucSubEditor and event handler for Click

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    RaiseEvent ValueChanged(Me, EventArgs.Empty)
    End Sub

    After clicking on this button, all values are saved.

    As per them, you need to add event handler for InputPanel items on value change or validating and raise ValueChange event from there.


    Prabhat Sharma.

  • Posted 24 January 2022, 5:34 am EST


    This is not an answer to what is NOT the problem I think I clearly demonstrated in the above example.

    The problem is that the radio button in an input panel is set during the ```

    Public Sub SetValue(value As Object) Implements ISubEditor.SetValue

    at some point before the subeditor is displayed, the radio button is set back to whatever it was set when the subeditor was previously opened.
    Please do not take 3 months to fix this issue.
     The values are saving to the sheet fine without your code. The standard VB radio button works correctly, the input panel radio button does not.
  • Posted 26 January 2022, 11:10 pm EST


    Sorry for the inconvenience. We checked the issue again and explored the sample you provided and it looks like when the TabIndex property of the InputPanel is set to 0, the issue occurs, and if change it to something else it works fine.

    We have reported it to the development team and will let you know when we have any updates. In the meantime, please try changing the TabIndex of the InputPanel and let us know if the issue perists.



  • Posted 25 May 2022, 4:03 pm EST

    Hi Kingman,

    The issue has been fixed in the latest C1 2022v1 Hotfix release. Please update to the hotfix release and let us know if you face any issues.



Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels