473,503 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

datagridboolcolumn and sql server

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 a datagrid
that shows several columns of the table (with datagridtextboxcolumns)
I also included a datagridboolcolumn with true-value 'true' and
false-value 'false' and allownull=false. I had the sqldataadapter made
the dataset that is used for this datagrid. The DataSet has (when I
look into the xml-schema) a type for this ok-column boolean.
But it doesn't work. When running the application I can change the
column (which permanently shows the grey-null-state), but it
immediately changes back to its grey-null-state. When saving to the
database the value in the database is changed, but it never reappears
in my dataset.

What am I doing wrong. I searched a lot of sites, but didn't find the
answer yet.

Erald Kulk
Nov 15 '05 #1
1 1667
Hi,

Two suggestions:

1. Design a typed dataset up front and populate it with the data adapter;
2. Inherit from the DataGridBoolColumn and override GetColumnValueAtRow and
SetColumnValueAtRow methods. Examine what is returned by the inherited
implementation, and you might get a better understanding of what is going
wrong.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Erald Kulk" <er***@delta-travel.nl> wrote in message
news:d9**************************@posting.google.c om...
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 a datagrid
that shows several columns of the table (with datagridtextboxcolumns)
I also included a datagridboolcolumn with true-value 'true' and
false-value 'false' and allownull=false. I had the sqldataadapter made
the dataset that is used for this datagrid. The DataSet has (when I
look into the xml-schema) a type for this ok-column boolean.
But it doesn't work. When running the application I can change the
column (which permanently shows the grey-null-state), but it
immediately changes back to its grey-null-state. When saving to the
database the value in the database is changed, but it never reappears
in my dataset.

What am I doing wrong. I searched a lot of sites, but didn't find the
answer yet.

Erald Kulk


Nov 15 '05 #2

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

Similar topics

0
1066
by: subT | last post by:
created several tablestyles, added columstyles..added datagridboolcolumn to one of the collections.. I dont have a problem with the required 2 clicks to change a checkbox value, however, on the...
2
2137
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
6678
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
3346
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...
1
1606
by: Edward Koucherian | last post by:
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"...
2
2311
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
1584
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...
0
966
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
962
by: Brett Romero | last post by:
I've created a DataGrid DataGridBoolColumn column in a tablestyle and mapped it correctly to a datatable. Problem is the column is always grayed and I can't uncheck it. I have the...
0
7194
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
7070
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...
1
6976
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
7449
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...
1
4993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
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
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1495
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 ...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.