checkbox column only allows single checked or unchecked

Posted by: relius1 on 8 September 2017, 2:00 pm EST

  • Posted 8 September 2017, 2:00 pm EST

    Programming in VB.NET, using VisualStudio 2008 and FarPoint Spread v.4.0.3510.2008...


    I have a 3-column spread, 2 of the columns are checkboxes. The 1st checkbox column is initially all checked, the 2nd is initially all unchecked. The 1st column will never allow more than one box unchecked. The 2nd will never allow more than one checked. Is this a bug, or have I done something wrong? See the sample code below. Thanks for your help.


    Project consists of a single form containing only a single spread, all properties defaulted except size and location. Code consists of FillTable called from Sub New of my form, and InitializeGrid called from FillTable:


       Private m_dtOptions As DataTable


     


       Private Sub InitializeGrid()


          With FpSpread1.ActiveSheet


             .DataSource = m_dtOptions.DefaultView


     


             With .ColumnHeader


                .Cells(0, 0).Text = "Allow"


                .Cells(0, 1).Text = "Description"


                .Cells(0, 2).Text = "Update"


             End With


     


             Dim checkboxtype As New FarPoint.Win.Spread.CellType.CheckBoxCellType


     


             .Columns(0).CellType = checkboxtype


             .Columns(0).Width = 60


             .Columns(0).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center


             .Columns(0).Locked = False


     


             .Columns(1).Width = 100


             .Columns(1).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center


             .Columns(1).Locked = True


     


             .Columns(2).CellType = checkboxtype


             .Columns(2).Width = 60


             .Columns(2).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center


             .Columns(2).Locked = False


          End With


       End Sub


      


       Private Sub FillTable()


          m_dtOptions = New DataTable("OPTIONS")


          m_dtOptions.Columns.Add("ALLOW", GetType(System.Boolean))


          m_dtOptions.Columns.Add("OPTION", GetType(System.String))


          m_dtOptions.Columns.Add("UPDATE", GetType(System.Boolean))


     


          Dim drowData As DataRow


     


          drowData = m_dtOptions.NewRow


          drowData.Item("ALLOW") = True


          drowData.Item("OPTION") = "Option 1"


          drowData.Item("UPDATE") = False


          m_dtOptions.Rows.Add(drowData)


     


          drowData = m_dtOptions.NewRow


          drowData.Item("ALLOW") = True


          drowData.Item("OPTION") = "Option 2"


          drowData.Item("UPDATE") = False


          m_dtOptions.Rows.Add(drowData)


     


          drowData = m_dtOptions.NewRow


          drowData.Item("ALLOW") = True


          drowData.Item("OPTION") = "Option 3"


          drowData.Item("UPDATE") = False


          m_dtOptions.Rows.Add(drowData)


     


          drowData = m_dtOptions.NewRow


          drowData.Item("ALLOW") = True


          drowData.Item("OPTION") = "Option 4"


          drowData.Item("UPDATE") = False


          m_dtOptions.Rows.Add(drowData)


     


          drowData = m_dtOptions.NewRow


          drowData.Item("ALLOW") = True


          drowData.Item("OPTION") = "Option 5"


          drowData.Item("UPDATE") = False


          m_dtOptions.Rows.Add(drowData)


     


          FpSpread1.ActiveSheet.DataSource = m_dtOptions.DefaultView


     


          InitializeGrid()


       End Sub

  • Replied 8 September 2017, 2:00 pm EST

    Hello,


     


    I have tried the same code and able to replicate this issue with version 4.0.3510.2008.


    However, using the latest version 4.0.3512.2008, the application is working perfectly fine.


     


    I would suggest you to please download the latest build (4.0.3512.2008) from here:


    ftp://ftp.fpoint.com/SpreadWinForms4/spwin4_net35-3512.zip


     


    I have also attached the sample application along with this mail.


     


    Regards,


    Amit


    2009/08/CheckBoxCellType.zip
  • Replied 8 September 2017, 2:00 pm EST

    Thanks, Amit. I had to get approval before downloading the latest version. I installed it tonight and it does fix the problem, so I am very happy. Thanks again.
Need extra support?

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

Learn More

Forum Channels