Data grid boolean filed

I have a boolean field  (bit) in a table and I used datagrid.
 What i want is to make the col. of this field format as a boolean or a check box not 0 and 1

 (How to make the format of a col. in a data grid as boolean or checkbox at run time not in the design time?)

Who is Participating?
Bob LearnedConnect With a Mentor Commented:
What other way did you choose to use?
When the particular row or col in the grid gets the focus, move the appropriate control to the particular grid position. For example, if you want to limit the user to key in either 0 or 1,  you can preload it in a combo box and move the control to the particular x and y position.
Éric MoreauSenior .Net ConsultantCommented:
I currently have the same problem. The nearest I found is to have a Yes/No field using this code:

Private Sub FillGridImportFile()
Dim fmtBooleanData As StdDataFormat

    With grdImport
        Set .DataSource = mobjSungard.GetGridImportSource

            .Columns(0).Locked = True
            ' set up Boolean Formatting
            Set fmtBooleanData = New StdDataFormat
            fmtBooleanData.Type = fmtBoolean
            fmtBooleanData.TrueValue = "Yes"
            fmtBooleanData.FalseValue = "No"
            fmtBooleanData.NullValue = ""
            Set .Columns(0).DataFormat = fmtBooleanData
            .Columns(1).Locked = True
            .Columns(2).Locked = True
            .Columns(3).Locked = True
    End With
    Call GridGotoTop
End Sub

If you find something, please advise me!
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Bob LearnedCommented:
You can also access the by looking at the Properties dialog (Format tab).  You can change the column to boolean format.

This control does not allow for actual check boxes in the grid, which goes against what the CheckBoxes format implies.
ahmosaAuthor Commented:

you are right THELEARNEDONE any way i used another way u may send your answer

any way any one know how to use logonserver or connect with crystal report to log on sql server

ahmosaAuthor Commented:
I used mflexgrid
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.