Boolean value in DataGrid column, checkbox? 
Author Message
 Boolean value in DataGrid column, checkbox?

I am using a datagrid to display a number of columns from an Access
database, some of which will contain a boolean value.   How can I display a
checkbox in the columns of the datagrid to make it more user friendly
(instead of "0" or "-1")?

Your help is greatly appreciated.
Thanks
-Ron

--
Remove the "X" from my email address for replies.



Fri, 11 Jan 2002 03:00:00 GMT  
 Boolean value in DataGrid column, checkbox?

Quote:

> I am using a datagrid to display a number of columns from an Access
> database, some of which will contain a boolean value.   How can I display a
> checkbox in the columns of the datagrid to make it more user friendly
> (instead of "0" or "-1")?

  I don't know how to do a checkbox in a Grid - if you get an answer on
that, please post it!  How about displaying a word the user will
understand, like "Yes/No" or "True/False"?
  If your grid is bound to a control, use an SQL expression for its
RecordSource;  if loading the grid via code, same idea - substitute your
real feild and table names (this should be all on one line, or else use
proper line splitting punctuation):

  SELECT SomeField, AnotherField, IIf(BooleanFieldName=0, "No", "Yes")
AS MyMoreFriendlyField FROM MyTable

The IIF expression will evaluate the record's value in your Boolean
field, and plug in the corresponding English word when it populate the
grid.
--
Jim in Cleveland
If you're writing to me, in my address
change "REAL_Address.see.below" to "worldnet.att.net"

"What's so funny 'bout peace, love & understanding?"
     - Nick Lowe



Fri, 11 Jan 2002 03:00:00 GMT  
 Boolean value in DataGrid column, checkbox?
Hi

    You can make use of the custom property of the datagrid, it is second
after (about) in the
property window. Double click the custom property, select the format tab,
select the coloumn
to be formated as check box, select the check box option in the available
list.

This would display 1(one) for rows that has values and 0(zero) for rows that
does not
have a value

Regards
S. Gayathri


Quote:
> I am using a datagrid to display a number of columns from an Access
> database, some of which will contain a boolean value.   How can I display
a
> checkbox in the columns of the datagrid to make it more user friendly
> (instead of "0" or "-1")?

> Your help is greatly appreciated.
> Thanks
> -Ron

> --
> Remove the "X" from my email address for replies.



Sun, 13 Jan 2002 03:00:00 GMT  
 Boolean value in DataGrid column, checkbox?


Quote:
> Hi

>     You can make use of the custom property of the datagrid, it is
second
> after (about) in the
> property window. Double click the custom property, select the format
tab,
> select the coloumn
> to be formated as check box, select the check box option in the
available
> list.

> This would display 1(one) for rows that has values and 0(zero) for
rows that
> does not
> have a value

> Regards
> S. Gayathri


I am having the same problem - don't want the 0 and 1 to display. Would
like a checkbox, preferably. But if that is not possible, at least "T"
or "F". Trying to figure out how to use the DataFormat property of
the column object to do this , but not having success. Can anyone tell
me how this is done?

Dan

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Tue, 22 Jan 2002 03:00:00 GMT  
 Boolean value in DataGrid column, checkbox?
Worked on this a little more. Was able to display "Y" and "N" by setting
the column format to Boolean and changing the true value from True to T
and the false value from False to F. This will be adequate for my needs,
but it looks like 3rd party grids are the only way to get really good
results.

Dan



Quote:


> > Hi

> >     You can make use of the custom property of the datagrid, it is
> second
> > after (about) in the
> > property window. Double click the custom property, select the format
> tab,
> > select the coloumn
> > to be formated as check box, select the check box option in the
> available
> > list.

> > This would display 1(one) for rows that has values and 0(zero) for
> rows that
> > does not
> > have a value

> > Regards
> > S. Gayathri

> I am having the same problem - don't want the 0 and 1 to display.
Would
> like a checkbox, preferably. But if that is not possible, at least "T"
> or "F". Trying to figure out how to use the DataFormat property of
> the column object to do this , but not having success. Can anyone tell
> me how this is done?

> Dan

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


Tue, 22 Jan 2002 03:00:00 GMT  
 Boolean value in DataGrid column, checkbox?
I would try the DataFormat, in the Format Event you could
create a CheckBox and paint it over the row/column.
I don't know if this works when you want to display
ALL elements but for one it surely would work.
(I just tried it with a ComboBox and the RowColChange event)
just give it a try if nothing else helps

so long..
jens

Quote:

> Worked on this a little more. Was able to display "Y" and "N" by setting
> the column format to Boolean and changing the true value from True to T
> and the false value from False to F. This will be adequate for my needs,
> but it looks like 3rd party grids are the only way to get really good
> results.

> Dan





> > > Hi

> > >     You can make use of the custom property of the datagrid, it is
> > second
> > > after (about) in the
> > > property window. Double click the custom property, select the format
> > tab,
> > > select the coloumn
> > > to be formated as check box, select the check box option in the
> > available
> > > list.

> > > This would display 1(one) for rows that has values and 0(zero) for
> > rows that
> > > does not
> > > have a value

> > > Regards
> > > S. Gayathri

> > I am having the same problem - don't want the 0 and 1 to display.
> Would
> > like a checkbox, preferably. But if that is not possible, at least "T"
> > or "F". Trying to figure out how to use the DataFormat property of
> > the column object to do this , but not having success. Can anyone tell
> > me how this is done?

> > Dan

> > Sent via Deja.com http://www.deja.com/
> > Share what you know. Learn what you don't.

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.



Tue, 22 Jan 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Boolean value in DataGrid column, checkbox?

2. Boolean value in DataGrid column, checkbox?

3. DataGrid: Displaying boolean columns as checkboxes or strings

4. DataGrid: Displaying boolean columns as checkboxes or strings

5. DataGrid: Displaying boolean columns as checkboxes or strings

6. Formatting Datagrid Column for Boolean Values

7. Dynamically Added Datagrid Template Column - Checkbox.Checked state in Column Header

8. Boolean column in Datagrid

9. Datagrid Boolean Column

10. Help with Datagrid and boolean column

11. Update boolean values in datagrid

12. Formatting Boolean Values in DataGrid

 

 
Powered by phpBB® Forum Software