Custom sub editor with C1InputPanel Weirdness

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

  • Posted 13 December 2020, 8:09 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:
    fpSpreadCustomDropDown.zip
    -Kingman
  • Replied 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.

    Regards,
  • Replied 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,
    irb1.CheckedChanged,
    irb2.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.
    -Kingman
    I am using the latest versions of Spread (14.45.20201.0) and C1 (4.5.2)





  • Replied 15 December 2020, 10:18 pm EST

    Hello,

    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.

    Regards,
    Ruchir
Need extra support?

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

Learn More

Forum Channels