|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Handling events for Checkbox in Data Grid-------------------------------- From: Abhijit Salvi Hi All, I am working on a DataGrid that has a column of Checkbox Controls. There is some Business Functionality that I need to accomplish when the Checkboxes in the column are checked or unchecked, basically on the 'onCheckChanged' Event of the checkbox. However I am not able to get handle to this event of the Checkbox. I have found numerous examples on the net for Checkbox in Repeaters but I guess the same does not work with checkbox in Data Grids. The 'onCheckChanged' event needs to be "raised". I get the following errors 'Public Event CheckedChanged(sender As Object, e As System.EventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event. 'System.EventHandler' is a delegate type. Delegate construction permits only a single AddressOf expression as an argument list. Often an AddressOf expression can be used instead of a delegate construction. Have you or any body you know tried using Checkboxes in datagrid. I would greatly appreciate any help wrt this. Thanks in advance, Regards, Abhijit ----------------------- Posted by a user from .NET 247 (http://www.dotnet247.com/) <Id>o7c/dY/i9k++mHwoB+IKcQ==</Id> Hi Abhijit,
In order to fire and handle the event of some server control inside a datagrid, you can do following steps: 1. In its HTML code, set AutoPostBack=true and there is an event trigger, e.g. OnCheckedChanged ="Event_handler_method_name". 2. There a Event_handler_method with two Args, Object and EventArgs. In your case, it could be: Public[/Protected] Sub CheckedChanged(sender As Object, e As System.EventArgs) ' Code here End Sub 3. Then coding in the method. That's it! HTH Elton Wang elton_w***@hotmail.com >-----Original Message----- Checkbox Controls. There is some Business Functionality >(Type your message here) > >-------------------------------- >From: Abhijit Salvi > >Hi All, > > I am working on a DataGrid that has a column of that I need to accomplish when the Checkboxes in the column are checked or unchecked, basically on the 'onCheckChanged' Event of the checkbox. > Checkbox in Repeaters but I guess the same does not work > However I am not able to get handle to this event of the Checkbox. > > I have found numerous examples on the net for with checkbox in Data Grids. The 'onCheckChanged' event needs to be "raised". > System.EventArgs)' is an event, and cannot be called > I get the following errors > 'Public Event CheckedChanged(sender As Object, e As directly. Use a 'RaiseEvent' statement to raise an event. > construction permits only a single AddressOf expression as >'System.EventHandler' is a delegate type. Delegate an argument list. Often an AddressOf expression can be used instead of a delegate construction. > in datagrid. I would greatly appreciate any help wrt this.> Have you or any body you know tried using Checkboxes Show quoteHide quote > > Thanks in advance, > >Regards, >Abhijit > >----------------------- >Posted by a user from .NET 247 (http://www.dotnet247.com/) > ><Id>o7c/dY/i9k++mHwoB+IKcQ==</Id> >. >
5th Re-Post with NO RESPONSE FROM MS!
Hyperlink Format Can't get a reference to user control in datagrid How to capture CheckChanged event from Radiobutton in Datagrid? Problem with Top And Bottom Paging email validation radiobutton and datagrid DataGrid sort when Editing How to put the result of 2 DataReader in a DataList?? e.item.dataitem |
|||||||||||||||||||||||