473,487 Members | 2,674 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Datagrid - problem

Hi,
I have a problem while adding a Check box column in a data
grid.
Let me explain the steps that i have follwed
1. I have created a table (using Sql Server 2000) with 4
columns, out of which 3 columns are intented for check box
options. Those 3 fields are of type tinyint, intended to
store 0 when checkbox is not selected 1 , when it is
selected.
2. I have created a dataset through a select query for the
same and mapped to the DataGrid.DataSource = <DataView>.
3. I have created a required DataGridTableStyle, created 3
dataGridBoolColumn and one DataGridTextBoxColumn and
mapped appropriately with the Database column names.
4. Then added other necessary code and executed the same.
Check boxes are shown in the runtime,but in a tri state
color, even if the .AllowNull = false.
5. When i move the control from one check column to other
check box column it is not maintaining the checked state.
It goes back to the tristate color.

Please provide me a solution
Thanks and regards
Ramesh
Nov 20 '05 #1
2 981
Exactly, not having the idea why it happens. But, you may try to use bit
datatype instead of tinyint datatype in sqlserver.

Rajesh Patel

"Ramesh" <do*******@hotmail.com> wrote in message
news:05****************************@phx.gbl...
Hi,
I have a problem while adding a Check box column in a data
grid.
Let me explain the steps that i have follwed
1. I have created a table (using Sql Server 2000) with 4
columns, out of which 3 columns are intented for check box
options. Those 3 fields are of type tinyint, intended to
store 0 when checkbox is not selected 1 , when it is
selected.
2. I have created a dataset through a select query for the
same and mapped to the DataGrid.DataSource = <DataView>.
3. I have created a required DataGridTableStyle, created 3
dataGridBoolColumn and one DataGridTextBoxColumn and
mapped appropriately with the Database column names.
4. Then added other necessary code and executed the same.
Check boxes are shown in the runtime,but in a tri state
color, even if the .AllowNull = false.
5. When i move the control from one check column to other
check box column it is not maintaining the checked state.
It goes back to the tristate color.

Please provide me a solution
Thanks and regards
Ramesh

Nov 20 '05 #2
Hi Rajesh,
Thanks for ur timely reply. I changed the the datatype as
Bit, now its working fine.
Thanks and regards
Ramesh
-----Original Message-----
Exactly, not having the idea why it happens. But, you may try to use bitdatatype instead of tinyint datatype in sqlserver.

Rajesh Patel

"Ramesh" <do*******@hotmail.com> wrote in message
news:05****************************@phx.gbl...
Hi,
I have a problem while adding a Check box column in a data grid.
Let me explain the steps that i have follwed
1. I have created a table (using Sql Server 2000) with 4
columns, out of which 3 columns are intented for check box options. Those 3 fields are of type tinyint, intended to
store 0 when checkbox is not selected 1 , when it is
selected.
2. I have created a dataset through a select query for the same and mapped to the DataGrid.DataSource = <DataView>.
3. I have created a required DataGridTableStyle, created 3 dataGridBoolColumn and one DataGridTextBoxColumn and
mapped appropriately with the Database column names.
4. Then added other necessary code and executed the same. Check boxes are shown in the runtime,but in a tri state
color, even if the .AllowNull = false.
5. When i move the control from one check column to other check box column it is not maintaining the checked state. It goes back to the tristate color.

Please provide me a solution
Thanks and regards
Ramesh

.

Nov 20 '05 #3

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

Similar topics

2
9905
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
0
3131
by: Emerson | last post by:
The following assumes a System.Windows.Forms.DataGrid with a System.Data.DataTable set as the DataSource. I'm programming in C# Here's my scenario I click in a cell on a DataGrid. I enter some...
5
2562
by: Jeff | last post by:
IDE: VS 2003 :NET OS: XP Pro My app have a form with a tab-control on it. The tab-control have 2 tabpages. One of the tabpages displays a datagrid, and the other tabpage displays details (order...
1
4275
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
4
2102
by: The Alchemist | last post by:
I am having a problem with a dynamically-generated Datagrid. It is important to point out that this problem does not exist with a design-time created Datagrid, but only with a dynamically generated...
9
5036
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ...
4
3474
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
0
1682
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
9
2706
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
2
6556
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
0
7106
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
6967
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
7137
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
7181
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
6846
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
7349
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
1381
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
600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
267
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.