473,396 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

CheckBox in a DataGrid and a datatable field

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?

Thanks,
Just D.

Nov 16 '05 #1
0 2129

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: michael walser | last post by:
display checkbox in datagrid. I find that there are 3 status: checked - check box with click icon unchecked - blank in check box unknown - click icon but color in gray..... How can I set the...
0
by: Just D | last post by:
Hi All, Does anybody know how to write the following code? I have a database table with a few columns including: ID , "Task" , ForceRun . I need to show the DataGrid on the ASPX page with...
3
by: Moe Sizlak | last post by:
Hi, Can I check a checkbox by default based on the value returned from a database? for example if the value (dr("frm7value")) returned from a db field is "YES" how can I check the checkbox by...
5
by: TPS | last post by:
I have a checkbox column in my datagrid. This checkbox triggers an autopostback. When I postback, I need to tell what row the user is on so I can tell what check box was checked or unchecked. ...
0
by: Mike Donnelly | last post by:
I have been fighting a checkbox problem for a couple of days with no luck On my main page a used a SQL reader to read all of my stores into a datatable in the first column then added a second...
10
by: Jennyfer J Barco | last post by:
Hello, I have a datagrid that brings some information from a query. I need to have a checkbox in each row so the user can select the rows he wants to reprint. Is it possible to have a checkbox...
2
by: Andre Ranieri | last post by:
Hi folks, I have a datagrid which contains a template item checkbox column. I've included a checkbox as a HeaderTemplate item which fires a server-side function to check or uncheck all the...
4
by: wink martindale | last post by:
Hello All, I am certain this has been asked before, but here goes: How do I add a checkbox to a datagrid that is not related to a field in the database? This checkbox will enable the user to...
6
by: Bill Nguyen | last post by:
I need to add a checkbox in front of all the rows in a datagrid so that users can select/unselect them. Any help is greatly appreciated! Bill
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.