ahmosa
asked on
Data grid boolean filed
Hi
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?)
Thanx
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?)
Thanx
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.
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.GetGridImportS ource
.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!
Private Sub FillGridImportFile()
Dim fmtBooleanData As StdDataFormat
With grdImport
Set .DataSource = mobjSungard.GetGridImportS
.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!
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.
This control does not allow for actual check boxes in the grid, which goes against what the CheckBoxes format implies.
ASKER
Hi
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
Thanx
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
Thanx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I used mflexgrid