Current filter:
                                You should refresh the page.
                                0
                                  • I've added a bound checkbox column (via the repository item) to a grid. It is a boolean datatype. The checkbox appear in the grid but instead of a check (or not) it shows a small black square in the center of the checkbox. When I check it is shows the check as expected but then when I click another row it reverts back to the square. What is happening?

                                    Eric

                                0

                                Here's the code that used to define the grid checkbox column

                                 Dim Col8 As GridColumn = grdViewFine.Columns.AddField("OKtoPost")
                                        With Col8
                                            .OptionsColumn.ReadOnly = False
                                            .Width = 75
                                            .Caption = "OK to" & vbCrLf & "Post"
                                            .VisibleIndex = grdViewFine.Columns.Count
                                            .OptionsColumn.AllowEdit = True
                                            .DisplayFormat.FormatType = DevExpress.Utils.FormatType.None
                                            .AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center
                                        End With
                                        Dim riCheckEdit As RepositoryItemCheckEdit = New RepositoryItemCheckEdit
                                        riCheckEdit.CheckStyle = DevExpress.XtraEditors.Controls.CheckStyles.Standard
                                        riCheckEdit.ValueChecked = True
                                        riCheckEdit.ValueUnchecked = False
                                        riCheckEdit.NullStyle = DevExpress.XtraEditors.Controls.StyleIndeterminate.Unchecked
                                        grdFine.RepositoryItems.Add(riCheckEdit)
                                        Col8.ColumnEdit = riCheckEdit

                                0

                                I forgot to add that after I set the repository item nullstyle the checkbox now appears but always shows unchecked. It is not binding the datatable value correctly. The column values should be set to TRUE. When I check the box it changes to the unchecked state when I move to a new row.

                                0

                                Hello,

                                Thank you for the report. However, I'm not sure how to recreate this problem. Please review my sample. It seems everything works fine for me if I use your code snippet.

                                Thank you, Marina

                                Q231892.zip
                                0

                                Thanks Marina,

                                I looked at your example and noted the command "gridview.columns.clear" just prior to assigned the datasource to the grid. I didn't have that nor did I include those lines in what I sent you. With that command the boolean column works as expected; without it it does not.

                                Just another subtlety.

                                Thanks again.
                                Eric

                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.