Datagrid - problem

  • Thread starter Thread starter Ramesh
  • Start date Start date
R

Ramesh

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
 
Exactly, not having the idea why it happens. But, you may try to use bit
datatype instead of tinyint datatype in sqlserver.

Rajesh Patel
 
Hi Rajesh,
Thanks for ur timely reply. I changed the the datatype as
Bit, now its working fine.
Thanks and regards
Ramesh
 
Back
Top