Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Checkboxes in a Datagrid problem

Reply
Thread Tools

Checkboxes in a Datagrid problem

 
 
REB
Guest
Posts: n/a
 
      03-01-2004
I have a datagrid that retrieves 3 fields per record row from a SQL server
2000 database table, the data it retrieves looks like this:

Violation Notice Date Type of Violation
<True/False> 3/1/03 Speeding
<True/False> 2/10/04 Ran a stop light

The <True/False> is a checkbox and signifies that we have received the
paperwork for the violation. Now onto my problems. First off I changed the
first column to a templated column and put in a checkbox and set its
databind text and checked propety to use the correct column from the data
source (source is a SQL bit column that only contains a 0 or a 1). This
worked, but only for the first row in the grid, each additional row would
show the same exact value from the first row. For example, I had 3 records
and if the first one had a value of true all of them showed true even though
I verified that some were false. If I changed the first row to a false
value in SQL table then all rows show false.

My second problem is when a checkbox is changed (CheckChanged event) I want
to save the bit value back to the database so records can be updated right
from the datagrid. How can I do this? Can someone help me out?

Thanks alot,
REB


 
Reply With Quote
 
 
 
 
REB
Guest
Posts: n/a
 
      03-01-2004
I discovered my error as to why I was getting repeating values from the
checkbox, but still need some help on how to make a CheckChanged event for
the checkbox in the datagrid so it will save to the database?

Thanks,
REB

"REB" <(E-Mail Removed)> wrote in message
news:uPb$Y96$(E-Mail Removed)...
> I have a datagrid that retrieves 3 fields per record row from a SQL server
> 2000 database table, the data it retrieves looks like this:
>
> Violation Notice Date Type of Violation
> <True/False> 3/1/03 Speeding
> <True/False> 2/10/04 Ran a stop light
>
> The <True/False> is a checkbox and signifies that we have received the
> paperwork for the violation. Now onto my problems. First off I changed

the
> first column to a templated column and put in a checkbox and set its
> databind text and checked propety to use the correct column from the data
> source (source is a SQL bit column that only contains a 0 or a 1). This
> worked, but only for the first row in the grid, each additional row would
> show the same exact value from the first row. For example, I had 3

records
> and if the first one had a value of true all of them showed true even

though
> I verified that some were false. If I changed the first row to a false
> value in SQL table then all rows show false.
>
> My second problem is when a checkbox is changed (CheckChanged event) I

want
> to save the bit value back to the database so records can be updated right
> from the datagrid. How can I do this? Can someone help me out?
>
> Thanks alot,
> REB
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem sorting a Datagrid with Checkbox columns (checkboxes not following sort) Scott ASP .Net 2 08-09-2007 02:07 PM
Checkboxes checked in runtime datagrid DJ Dev ASP .Net 7 02-10-2004 05:41 PM
Re: CheckBoxes in Datagrid Jos ASP .Net 0 08-19-2003 12:04 PM
Re: Checkboxes in a datagrid S. Justin Gengo ASP .Net 7 08-16-2003 02:15 AM
ViewState Problem with CheckBoxes in a DataGrid kannadasan ASP .Net 1 06-25-2003 06:43 AM



Advertisments