473,729 Members | 2,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2158

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

Similar topics

2
7545
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 check box only 2 status, checked and unchecked?
0
1003
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 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
3
5227
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 default? Moe
5
3009
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. Can't seem to find that property. Thanks.
0
1221
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 column (boolean) and set all itmes to true. this repersents that all stores are initially set to show. I then created a popup page with a datagrid. I out in a templeted column of type checkBox.
10
2442
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 control in a datagrid? Now I have a Select column but the problem is that the user needs to select more than one record and send them all to print, instead of being one by one like is now with the Select column. Another question, is it possible to...
2
5455
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 values in the underlying datatable column, and resets the binding to the datagrid. The only problem is that, when the user pages back and forth in the datagrid, their selection is overwritten with the default selection in page load. So, if the...
4
1235
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 create a custom list by selecting the records they want to view. Any help would be much apprectiated,
6
1715
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
8913
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9280
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9142
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6016
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.