Capturing the Click Event(clientside) for a checkbox in a webgrid

3 replies. Last post: June 14, 2010 11:26 PM by Yudi
Tags :
  • (None)

What event is fired on the client side when the user checks a checbox on a webgrid? I need to capture it and open another webpage when this occurs...

Answers

If you are using our ISRowChecker for your checkbox, We have a clientside event called "OnCheckBoxClick". Hope you could use this event for your scenario.

Regards,
Handy

Yudi Member

Handy’s post has lead to the correct answer.

I made a simple test on my local by binding WebGrid to ‘Products’ table of Northwind database. The table has ‘Discontinued’ field which its data type is Boolean and represented as checkbox in WebGrid.

The column declared as follow.

<ISWebGrid:WebGridColumn Caption="Discontinued" DataMember="Discontinued" DataType="System.Boolean"
    Name="Discontinued" Width="100px" ColumnType="CheckBox" EditType="Checkbox">
</ISWebGrid:WebGridColumn>
...
<LayoutSettings AllowAddNew="Yes" AllowDelete="Yes" AllowEdit="Yes">
    <ClientSideEvents OnCheckBoxClick="WebGrid1_OnCheckBoxClick" />
</LayoutSettings>
...

I simply add OnCheckBoxClick client side event of WebGrid and put a single alert in it. The alert is invoked when I click any checkbox on ‘Discontinued’ column of WebGrid. So, OnCheckBoxClick client side event should be suitable with your scenario.

All Replies

If you are using our ISRowChecker for your checkbox, We have a clientside event called "OnCheckBoxClick". Hope you could use this event for your scenario.

Regards,
Handy

Unfortunately, I am just using checkbox.

 

Any other ideas?

Yudi Member

Handy’s post has lead to the correct answer.

I made a simple test on my local by binding WebGrid to ‘Products’ table of Northwind database. The table has ‘Discontinued’ field which its data type is Boolean and represented as checkbox in WebGrid.

The column declared as follow.

<ISWebGrid:WebGridColumn Caption="Discontinued" DataMember="Discontinued" DataType="System.Boolean"
    Name="Discontinued" Width="100px" ColumnType="CheckBox" EditType="Checkbox">
</ISWebGrid:WebGridColumn>
...
<LayoutSettings AllowAddNew="Yes" AllowDelete="Yes" AllowEdit="Yes">
    <ClientSideEvents OnCheckBoxClick="WebGrid1_OnCheckBoxClick" />
</LayoutSettings>
...

I simply add OnCheckBoxClick client side event of WebGrid and put a single alert in it. The alert is invoked when I click any checkbox on ‘Discontinued’ column of WebGrid. So, OnCheckBoxClick client side event should be suitable with your scenario.

All times are GMT -5. The time now is 9:40 AM.
Previous Next