473,382 Members | 1,431 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,382 software developers and data experts.

CheckBox in a dataGrid Event

Hello,
I've got a dataGrid which I have a bool column for a CheckBox. I'm setting
up a tableStyle for this. The checkboxes work fine. I'm trying to set up a
click (I think CheckChanged) event for the checkboxes so that if the user
checks/unchecks one it sets the underlying table value to true/false. I
think this should be set up in the tableStyle function but I'm not sure and
I'm unsure of the sytax of how to do it. Can someone give me a little sample
code of how to do this?
Thanks for any help...
Cheers :)
Nov 16 '05 #1
3 1476
Hello Randy,

I believe your only chance to intercept this event is to inherit from the
DataGrid control and
to override its OnMouseDown and (optionally) OnMouseUp methods. Then, use
the
HitTest method to determine whether the click occured in the column in
question and react
appropriately.

You might also possibly do without inheritance, just try to handle the
MouseDown and MouseUp
events first.

"Randy" <te**@temp.com> wrote in message
news:OA**************@tk2msftngp13.phx.gbl...
Hello,
I've got a dataGrid which I have a bool column for a CheckBox. I'm setting
up a tableStyle for this. The checkboxes work fine. I'm trying to set up a
click (I think CheckChanged) event for the checkboxes so that if the user
checks/unchecks one it sets the underlying table value to true/false. I
think this should be set up in the tableStyle function but I'm not sure and I'm unsure of the sytax of how to do it. Can someone give me a little sample code of how to do this?
Thanks for any help...
Cheers :)


Nov 16 '05 #2
Thanks for your help

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:%2***************@tk2msftngp13.phx.gbl...
Hello Randy,

I believe your only chance to intercept this event is to inherit from the
DataGrid control and
to override its OnMouseDown and (optionally) OnMouseUp methods. Then, use
the
HitTest method to determine whether the click occured in the column in
question and react
appropriately.

You might also possibly do without inheritance, just try to handle the
MouseDown and MouseUp
events first.

"Randy" <te**@temp.com> wrote in message
news:OA**************@tk2msftngp13.phx.gbl...
Hello,
I've got a dataGrid which I have a bool column for a CheckBox. I'm setting up a tableStyle for this. The checkboxes work fine. I'm trying to set up a click (I think CheckChanged) event for the checkboxes so that if the user checks/unchecks one it sets the underlying table value to true/false. I
think this should be set up in the tableStyle function but I'm not sure

and
I'm unsure of the sytax of how to do it. Can someone give me a little

sample
code of how to do this?
Thanks for any help...
Cheers :)

Nov 16 '05 #3
Thanks for your help

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:%2***************@tk2msftngp13.phx.gbl...
Hello Randy,

I believe your only chance to intercept this event is to inherit from the
DataGrid control and
to override its OnMouseDown and (optionally) OnMouseUp methods. Then, use
the
HitTest method to determine whether the click occured in the column in
question and react
appropriately.

You might also possibly do without inheritance, just try to handle the
MouseDown and MouseUp
events first.

"Randy" <te**@temp.com> wrote in message
news:OA**************@tk2msftngp13.phx.gbl...
Hello,
I've got a dataGrid which I have a bool column for a CheckBox. I'm setting up a tableStyle for this. The checkboxes work fine. I'm trying to set up a click (I think CheckChanged) event for the checkboxes so that if the user checks/unchecks one it sets the underlying table value to true/false. I
think this should be set up in the tableStyle function but I'm not sure

and
I'm unsure of the sytax of how to do it. Can someone give me a little

sample
code of how to do this?
Thanks for any help...
Cheers :)

Nov 16 '05 #4

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

Similar topics

2
by: andla | last post by:
Hi, How does events fire in a datagrid. I know about the problem if turning the viewstate off the events wil not fire properly even if I rebind the control in every postback. S then I started...
4
by: The Alchemist | last post by:
I am having a problem with a dynamically-generated Datagrid. It is important to point out that this problem does not exist with a design-time created Datagrid, but only with a dynamically generated...
0
by: Edward Bills | last post by:
Hello, I have an application that is currently running fine on IIS 5 in ASP.Net. When I install it on an IIS 6 server the datagrids disappear when I click any command that causes a postback. I...
1
by: Paul Smith | last post by:
I have entered some code in the CheckBox CheckChanged event, but it does not seem to be function. I want to run some code when the check box is changed, and code run depending on it's checked or...
2
by: dilip.movva | last post by:
Hi, In the ItemDataBound of my datagrid I am creating a checkbox dynamically. I have the eventhandler defined for CheckedChanged of the check box. The event is not firing. The grid is bound in the...
2
by: shuckjunkmail | last post by:
It was suggested that I re-submit this question as a new post rather than adding onto an old and unanswered post. The basic problem has to do with the .NET datagrid and sorting. I am having...
0
by: jdbss | last post by:
I'm using an unbound checkbox within a datagrid, listed below, and setting the initial value during page_load based upon some critieria. The problem is when I "Uncheck" a value that was...
5
by: c_shah | last post by:
using VB.net (2005) ASP.net 2.0 I have a repeater control with the item template, in the item template I have two checkboxes How to capture event When user checks the checkboxes? What event...
1
by: QuickBooksDev | last post by:
VB.NET 2005 DataGridView Checkbox - Check Event need to know check status I would like to use the DataGridView Checkbox like a normal checkbox. When someone clicks on it I would expect that I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.