By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,417 Members | 1,192 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,417 IT Pros & Developers. It's quick & easy.

Datagrid - problem

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.