writeable checkbox in datagrid from bit field in table

H

hazz

I am having a very difficult time with what should be an easy task.

I simply want to select these fields from the database table into the
GridView control and have checkboxes appear for which the user can select
which columns to include in a report.
The checkboxes are always read only, even when I set the value for readonly
to false in the BoundField GridView tasks (EditColumn).
Does anyone know of an example I can see, an article or just another way of
looking at what I may be missing here?
I can update the table in the database so I must have permissions to change
the table, at least from sql management studio. Maybe I need permissions
from within the website. Maybe thats why when I go into the wizard and
choose the advance option to create an UPDATE/INSERT query, it doesn't allow
me to check that box. Thanks, -Greg

SELECT COLUMN_NAME as [Data Item Name],

Column_ID as [Column Id],

Include_in_Report as [Include in Report] -- a bit data value

FROM ColumnsToSelect
 
G

Guest

Your checkbox will remain read only while your gridview is in readonly mode.
If you flip it into edit mode then it will become editable, although in order
for the cahnge to be written back to the DB you need to specify some kind of
insert command to the bound datasource.
 
H

hazz

I'm looking into this. Thank you.

clickon said:
Your checkbox will remain read only while your gridview is in readonly
mode.
If you flip it into edit mode then it will become editable, although in
order
for the cahnge to be written back to the DB you need to specify some kind
of
insert command to the bound datasource.

hazz said:
I am having a very difficult time with what should be an easy task.

I simply want to select these fields from the database table into the
GridView control and have checkboxes appear for which the user can select
which columns to include in a report.
The checkboxes are always read only, even when I set the value for
readonly
to false in the BoundField GridView tasks (EditColumn).
Does anyone know of an example I can see, an article or just another way
of
looking at what I may be missing here?
I can update the table in the database so I must have permissions to
change
the table, at least from sql management studio. Maybe I need permissions
from within the website. Maybe thats why when I go into the wizard and
choose the advance option to create an UPDATE/INSERT query, it doesn't
allow
me to check that box. Thanks, -Greg

SELECT COLUMN_NAME as [Data Item Name],

Column_ID as [Column Id],

Include_in_Report as [Include in Report] -- a bit data value

FROM ColumnsToSelect
 
H

hazz

Oh my gosh....the table I was using for the update didn't have an identity
column. Visual Studio is not going to let someone update a table it can't
update. Wheww!!! Bonehead me !!

clickon said:
Your checkbox will remain read only while your gridview is in readonly
mode.
If you flip it into edit mode then it will become editable, although in
order
for the cahnge to be written back to the DB you need to specify some kind
of
insert command to the bound datasource.

hazz said:
I am having a very difficult time with what should be an easy task.

I simply want to select these fields from the database table into the
GridView control and have checkboxes appear for which the user can select
which columns to include in a report.
The checkboxes are always read only, even when I set the value for
readonly
to false in the BoundField GridView tasks (EditColumn).
Does anyone know of an example I can see, an article or just another way
of
looking at what I may be missing here?
I can update the table in the database so I must have permissions to
change
the table, at least from sql management studio. Maybe I need permissions
from within the website. Maybe thats why when I go into the wizard and
choose the advance option to create an UPDATE/INSERT query, it doesn't
allow
me to check that box. Thanks, -Greg

SELECT COLUMN_NAME as [Data Item Name],

Column_ID as [Column Id],

Include_in_Report as [Include in Report] -- a bit data value

FROM ColumnsToSelect
 
H

hazz

but how do I get the checkbox value to stick?
After I select it, it gets checked.
But when I move onto the next row, it reverts back to an empty box.
hmmm.

clickon said:
Your checkbox will remain read only while your gridview is in readonly
mode.
If you flip it into edit mode then it will become editable, although in
order
for the cahnge to be written back to the DB you need to specify some kind
of
insert command to the bound datasource.

hazz said:
I am having a very difficult time with what should be an easy task.

I simply want to select these fields from the database table into the
GridView control and have checkboxes appear for which the user can select
which columns to include in a report.
The checkboxes are always read only, even when I set the value for
readonly
to false in the BoundField GridView tasks (EditColumn).
Does anyone know of an example I can see, an article or just another way
of
looking at what I may be missing here?
I can update the table in the database so I must have permissions to
change
the table, at least from sql management studio. Maybe I need permissions
from within the website. Maybe thats why when I go into the wizard and
choose the advance option to create an UPDATE/INSERT query, it doesn't
allow
me to check that box. Thanks, -Greg

SELECT COLUMN_NAME as [Data Item Name],

Column_ID as [Column Id],

Include_in_Report as [Include in Report] -- a bit data value

FROM ColumnsToSelect
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top