Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
365
Checking BoundCheckBoxField from Code Behind Throws Error
posted

I tried the following, but get the error "A cell value can only be set for cells that are part of an UnboundField".

Dim i As Int32
        Dim oRow As Infragistics.Web.UI.GridControls.GridRecord
        For i = 0 To Me.WHD1.Rows.Count - 1
            oRow = Me.WHD1.Rows(i)
                        with oRow.Item(6)
             .Value = True
            End With
        Next

What I am trying to do is check the checkbox in each row of the grid for column 6.

 

Parents
  • 33839
    Suggested Answer
    posted

    Hi dan2012a,

    The error message is telling you what the problem is.  You have a BoundCheckBoxField.  Bound field values cannot be set in the code behind.  You should change the values in the data source and rebind the grid.  Otherwise, use an UnboundCheckboxField.  This keeps track of values in the grid and is not bound to any particular data field.

    regards,
    David Young 

Reply Children