Intersoft WebGrid Documentation
OnCheckBoxClick Property
See Also  Example Send Feedback
ISNet.WebUI.WebGrid Namespace > ClientEvents Class : OnCheckBoxClick Property






Specifies the client side (JavaScript) function that will be invoked when checkbox is clicked.

Syntax

Visual Basic (Declaration) 
<ISNet.Serialization.XmlSerializableAttribute()>
<ISNet.Serialization.BinarySerializableAttribute()>
<EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="ISNet.WebUI.Design.ClientSideEventEditor, ISNet.WebUI.Design")>
<NotifyParentPropertyAttribute(True)>
<DescriptionAttribute("Specifies the client side (JavaScript) function that will be invoked when checkbox is clicked.")>
<ISNet.EventParameterAttribute("controlId, tblName, colName, checkboxValue, originalCheckBoxValue")>
<DefaultValueAttribute()>
Public Property OnCheckBoxClick As String
Visual Basic (Usage)Copy Code
Dim instance As ClientEvents
Dim value As String
 
instance.OnCheckBoxClick = value
 
value = instance.OnCheckBoxClick
C# 
[ISNet.Serialization.XmlSerializableAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="ISNet.WebUI.Design.ClientSideEventEditor, ISNet.WebUI.Design")]
[NotifyParentPropertyAttribute(true)]
[DescriptionAttribute("Specifies the client side (JavaScript) function that will be invoked when checkbox is clicked.")]
[ISNet.EventParameterAttribute("controlId, tblName, colName, checkboxValue, originalCheckBoxValue")]
[DefaultValueAttribute()]
public string OnCheckBoxClick {get; set;}
Delphi 
public read-write property OnCheckBoxClick: String; 
JScript 
ISNet.Serialization.XmlSerializableAttribute()
ISNet.Serialization.BinarySerializableAttribute()
EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="ISNet.WebUI.Design.ClientSideEventEditor, ISNet.WebUI.Design")
NotifyParentPropertyAttribute()
DescriptionAttribute("Specifies the client side (JavaScript) function that will be invoked when checkbox is clicked.")
ISNet.EventParameterAttribute("controlId, tblName, colName, checkboxValue, originalCheckBoxValue")
DefaultValueAttribute()
public function get,set OnCheckBoxClick : String
Managed Extensions for C++ 
[ISNet.Serialization.XmlSerializableAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="ISNet.WebUI.Design.ClientSideEventEditor, ISNet.WebUI.Design")]
[NotifyParentPropertyAttribute(true)]
[DescriptionAttribute("Specifies the client side (JavaScript) function that will be invoked when checkbox is clicked.")]
[ISNet.EventParameterAttribute("controlId, tblName, colName, checkboxValue, originalCheckBoxValue")]
[DefaultValueAttribute()]
public: __property string* get_OnCheckBoxClick();
public: __property void set_OnCheckBoxClick( 
   string* value
);
C++/CLI 
[ISNet.Serialization.XmlSerializableAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="ISNet.WebUI.Design.ClientSideEventEditor, ISNet.WebUI.Design")]
[NotifyParentPropertyAttribute(true)]
[DescriptionAttribute("Specifies the client side (JavaScript) function that will be invoked when checkbox is clicked.")]
[ISNet.EventParameterAttribute("controlId, tblName, colName, checkboxValue, originalCheckBoxValue")]
[DefaultValueAttribute()]
public:
property String^ OnCheckBoxClick {
   String^ get();
   void set (    String^ value);
}

Property Value

Returns return value.

Example

The sample code below will show you on how to display value in message box on the Cell number one.
C#Copy Code
WebGrid1.LayoutSettings.ClientSideEvents.OnCheckBoxClick = "WebGrid1_OnCheckBoxClick";
The following is the example of the javascript function that is assigned in above event.
JScriptCopy Code
{ 
     var WebGrid1 = ISGetObject(controlId); 

     alert("The customer's name that you choose is " + WebGrid1.GetSelectedObject().GetRowObject().GetCells  ().GetNamedItem("CustomerName").Text) 

     return true; 
}

Remarks

The user-defined function should only contain the name of the function. For example, "HandleEvent".

The function can be defined in either inline or linked JavaScript files and can accept following parameters:

gridId

The ID of the grid calling the function.

tblName

The table name of the clicked checkbox.

colName

The column name of the clicked checkbox.

checkboxValue

The value of the checkbox (true if checked).

Note that you should include the return value of your function. Returning a true value means that default behavior will be processed. Otherwise, the default behavior will be skipped.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

Reference

ClientEvents Class
ClientEvents Members

Tasks

How-to: Enable a ReadOnly cell when the CheckBox is checked using OnCheckBoxClick

Concepts

Events

©2012 Intersoft Solutions Corp. All Rights Reserved.