473,473 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DataGridBoolColumn is not displaying the proper values

I'm getting the incorrect display value on my DataGrid column.

The field is numeric (1) in the SQL database table
The Code is
txtCol = New DataGridBoolColumn
txtCol.MappingName = "MyCol"
txtCol.HeaderText = ""
txtCol.Width = 25
txtCol.ReadOnly = False
txtCol.AllowNull = False
txtCol.TrueValue = 1
txtCol.FalseValue = 0
dgStyle.GridColumnStyles.Add(txtCol)

DataGrid1.TableStyles.Add(dgStyle)
DataGrid1.DataSource = typeDS.Tables("Details")

It's displaying the Null values state and the values for that
DataGrd1(rowNum, colNum) is Null in the DataGridBoolColumn paint event.
The real value of the field in the table is 1 or 0. When I'm changing the
column type to DataGridTextBoxColumn it's displaying the proper value.

Can anyone help me on this problem?

Thanks in Advance
Ed
Nov 21 '05 #1
1 1601
Hi,

Maybe this will work

txtCol.TrueValue = "1"
txtCol.FalseValue = "0"
Ken
---------------------
"Edward Koucherian" <ed****@allamericanproducts.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I'm getting the incorrect display value on my DataGrid column.

The field is numeric (1) in the SQL database table
The Code is
txtCol = New DataGridBoolColumn
txtCol.MappingName = "MyCol"
txtCol.HeaderText = ""
txtCol.Width = 25
txtCol.ReadOnly = False
txtCol.AllowNull = False
txtCol.TrueValue = 1
txtCol.FalseValue = 0
dgStyle.GridColumnStyles.Add(txtCol)

DataGrid1.TableStyles.Add(dgStyle)
DataGrid1.DataSource = typeDS.Tables("Details")

It's displaying the Null values state and the values for that
DataGrd1(rowNum, colNum) is Null in the DataGridBoolColumn paint event.
The real value of the field in the table is 1 or 0. When I'm changing the
column type to DataGridTextBoxColumn it's displaying the proper value.

Can anyone help me on this problem?

Thanks in Advance
Ed

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Erald Kulk | last post by:
I have a problem with a datagridboolcolumn that drives me almost crazy. I have a sql server table with several columns of which one is a column called ok which is a bit with default value 0. In...
2
by: PeterZ | last post by:
Hi, In the past I've successfully databound a conventional Winforms checkbox to a number column in an Oracle table, where 1 represents true and 0 represents false. The checkbox would be ticked...
4
by: Ubi | last post by:
Hi, my code is: myDataTBL.Columns.Add("checked",System.Type.GetType("System.Boolean")); DataGridBoolColumn cs1 = new DataGridBoolColumn(); cs1.NullValue=false; cs1.TrueValue=true;...
2
by: James Goodman | last post by:
I have a number of bool columns within a datagrid, but they dont work as expected. The underlying table is Access 2000. The datatype for the underlying fields is Yes/No. I am attempting to...
0
by: Strahimir Antoljak | last post by:
I am having problems with DataGridBoolColumns not accepting/remembering value. I add DataGridBoolColumn to a TableStyle, then I add the TableStyle to a DataGrid, and set the DataGrid.DataSource...
2
by: nate axtell | last post by:
I'm trying to create a custom DataGridBoolColumn. I inherit DataGridColumnStyle and create a public CheckBox variable. This columnType will be mapped to a dataTable boolean column. What are the...
1
by: B.J. Raiford | last post by:
I have a DataGrid on a form in my application that is bound to an xml file and I have set the table style to contain a few columns with one editable one, a DataGridBoolColumn. I set...
2
by: NetRacer | last post by:
hi, i have a DataGrid with a DataGridBoolColumn. The assigned Column is a TinyInt and the values are only 0 or 1. I set these values to the TrueValue und FalseValue Property, but the CheckBox...
0
by: Ryan Liu | last post by:
Hi, I have a strange problem, should be very simple, take me days I couldn't finger out. Really appreciate if you can help me fine the problem. I am trying to use DataGridBoolColumn, but I...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.