I have a problem about checkbox and Web user control. I want tick checkbox when choose row in RadGrid. I use web page, I cant tick with this code:
But when I use Web User Control, I have error. This code is not excute. Have you any idea? Thanks you very much!
var chbox = document.getElementById("checkbox1");
chbox.checked = true;
But when I use Web User Control, I have error. This code is not excute. Have you any idea? Thanks you very much!
4 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 14 Sep 2011, 06:06 AM
Hello DucAnh,
I am not quite sure about your requirement. If you want to select the CheckBox while selecting the grid row, you can use GridClientSelectColumn(instead of using CheckBox control). For more information about GridClientSelectColumn, please have a look in to the following documetation .
Column Types
Thanks,
Princy.
I am not quite sure about your requirement. If you want to select the CheckBox while selecting the grid row, you can use GridClientSelectColumn(instead of using CheckBox control). For more information about GridClientSelectColumn, please have a look in to the following documetation .
Column Types
Thanks,
Princy.
0

Pham
Top achievements
Rank 1
answered on 14 Sep 2011, 07:26 AM
Hello Princy!
My requirement is select checkbox "CSPK"(in this image) when I choose row select - it isn't in radgrid:
My requirement is select checkbox "CSPK"(in this image) when I choose row select - it isn't in radgrid:
function setValues(d_diem_do) {
$find("<%= dtpNGAY_HLUC.ClientID %>").set_selectedDate(d_diem_do.NGAY_HLUC);
var chbox = document.getElementById("checkbox1");
chbox.checked = true;
}
0
Hi Ducanh,
One approach to achieve your goal is to hook the OnRowSelected client event and in its body to call your function. Thus when row is selected the checkbox outside the grid would be checked too. But notice that this code will execute every time when row is selected and it is not connected with particular row. This event is raised when any row from RadGrid is selected. This is an example illustrating the above mentioned approach:
All the best,
Andrey
the Telerik team
One approach to achieve your goal is to hook the OnRowSelected client event and in its body to call your function. Thus when row is selected the checkbox outside the grid would be checked too. But notice that this code will execute every time when row is selected and it is not connected with particular row. This event is raised when any row from RadGrid is selected. This is an example illustrating the above mentioned approach:
<script type=
"text/javascript"
>
function
RowSelected(sender, eventArgs) {
findCheckbox();
}
function
findCheckbox() {
var
chbox = document.getElementById(
"CheckBox1"
);
chbox.checked =
true
;
}
</script>
All the best,
Andrey
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
0

Pham
Top achievements
Rank 1
answered on 18 Sep 2011, 11:04 AM
Thanks Princy! Your idea is very accurate.