Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > CheckBox in a DataGrid and a datatable field

Thread Tools

CheckBox in a DataGrid and a datatable field

Just D
Posts: n/a
Hi All,

Does anybody know how to write the following code?

I have a database table with a few columns including: ID [int], "Task"
[varchar], ForceRun [bit]. I need to show the DataGrid on the ASPX page with
these selected fields and allow user to click one or more CheckBox controls
to activate this bit on the database table for a required ID.

I have already added a template column to the DataGrid and I can get the
CheckBox status from this CheckBox for each string. If I click a button
"Apply" on this page I can get a full list of changed items and send a SQL
command to the database to activate these bits. It works, but...

The customer wants this aspx page to be updated automatically, once per
selected time, for example one time per 10 seconds. I think that I have only
two possible ways to do that.

1. I need to read the status of these CheckBox controls from the DataGrid
and create a SQL string to send to the database immediately after changes,
just after the user clicked this control.
2. Wait for the auto refresh and work with the whole DataGrid before the
page is updated. I have this functions but I don't know how to call it
before updating of the page.

I used this tag to reload the page automatically. It works fine.

<meta http-equiv="refresh" content="10">

But it causes a full reload of the page including the datagrid and I can't
get the CheckBox status on Page_Load() because the DataGrid resets every
time on Page_Load(). I think that I need some event to check the status of
these CheckBox controls in the DataGrid before content reloading. But how?
If I go the first way, what event should I use to understand that the user
clicked the CheckBox to work with these changes after the changes have been
done before page refreshing?

Just D.

Reply With Quote

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
Sort a datatable and create a new datatable Fredrik Rodin ASP .Net 3 09-28-2007 07:28 AM
DataGrid and embeded Checkbox..How to find if checkbox clicked =?Utf-8?B?RG90TmV0RGV2?= ASP .Net 1 10-06-2006 04:11 PM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked. Joey Pang ASP .Net Datagrid Control 4 06-13-2005 02:29 AM
Re: CheckBox in a DataGrid and a datatable field Just D ASP .Net 0 05-24-2004 05:39 AM