9 Answers, 1 is accepted
0
Hi Darren,
Here is an example:
<ClientEvents OnRowSelecting="RowSelecting" />
function RowSelecting(sender, args)
{
if(!confirm('select?'))
args.set_cancel(true);
}
Sincerely yours,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Here is an example:
<ClientEvents OnRowSelecting="RowSelecting" />
function RowSelecting(sender, args)
{
if(!confirm('select?'))
args.set_cancel(true);
}
Sincerely yours,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Darren
Top achievements
Rank 1
answered on 15 Aug 2008, 04:06 PM
ty!
0

Darren
Top achievements
Rank 1
answered on 15 Aug 2008, 06:21 PM
The example you show here:
<ClientEvents OnRowSelecting="RowSelecting" />
function RowSelecting(sender, args)
{
if(!confirm('select?'))
args.set_cancel(true);
}
"args.set_cancel(true);" works, but only when you click on row. It does not work on the checkbox "radG:GridClientSelectColumn".
Should I use different event for this purpose?
0

Darren
Top achievements
Rank 1
answered on 15 Aug 2008, 07:08 PM
After I check more examples on this forum. I figure out the problem is the column radG:GridClientSelectColumn actually triggered before the RowSelecting event.
To solve my problem, I just need a code to set the check value of radG:GridClientSelectColumn when it click. Can you please show me how to do so?
To solve my problem, I just need a code to set the check value of radG:GridClientSelectColumn when it click. Can you please show me how to do so?
0
Hello Darren,
The selection is actually properly canceled in both cases - standard row selection and checkbox selection. This is demonstrated in the code project attached to this message. Take a look at it and let me know if I am leaving something out.
Greetings,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
The selection is actually properly canceled in both cases - standard row selection and checkbox selection. This is demonstrated in the code project attached to this message. Take a look at it and let me know if I am leaving something out.
Greetings,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Darren
Top achievements
Rank 1
answered on 18 Aug 2008, 06:22 PM
Dear Yavor:
Thank you for the reply and code. Your sample works. After looking into your code. I found the Rad.Grid version I am using is an old one. Which is from 2007 Q1 Rad.Controls.
On the top register tag in .aspx page, you use:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
My page is:
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %>
The version I am using seems has no RadScriptManager as well.
What is your suggestion? Do I post my question in wrong forum?
Thank you for the reply and code. Your sample works. After looking into your code. I found the Rad.Grid version I am using is an old one. Which is from 2007 Q1 Rad.Controls.
On the top register tag in .aspx page, you use:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
My page is:
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %>
The version I am using seems has no RadScriptManager as well.
What is your suggestion? Do I post my question in wrong forum?
0
Hello Darren,
You actually chose the grid for asp.net Ajax, which is the one I used in the local tests.
Attached to this message, is a sample using the classic version of the control. Take a look at it and let me know how it goes.
Kind regards,
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Darren
Top achievements
Rank 1
answered on 19 Aug 2008, 06:24 PM
Thank you for the test. The result is same as I tested. When you use checkbox to select the row, the cancel button won't cancel the checkbox from being checked. It only works on row select.
Darren L.
Darren L.
0
Accepted
Hi Darren,
In this case, you will need to modify the code a little bit. Based on the sample sent earlier, you can use the following javascript code:
.Js
Sincerely yours,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
In this case, you will need to modify the code a little bit. Based on the sample sent earlier, you can use the following javascript code:
.Js
<script type="text/javascript"> |
function rowSelecting(row) |
{ |
document.getElementById("txbDescription").value ="test"; |
if(!confirm('select?')) |
{ |
var radGrid1 = window["<%=RadGrid1.ClientID %>"]; |
var clientSelectCell = radGrid1.MasterTableView.GetCellByColumnUniqueName(row,"clientSelectColumn").innerHTML; |
radGrid1.MasterTableView.GetCellByColumnUniqueName(row,"clientSelectColumn").childNodes[0].checked=false; |
return false; |
} |
} |
</script> |
Sincerely yours,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.