<
telerik:RadNumericTextBox
ID
=
"txtStuAdds"
Width
=
"70px"
Value
=
"0"
DbValue='<%# Bind("StudentAdds") %>'
runat="server" Type="Number" NumberFormat-DecimalDigits="0" Onkeyup="txtStudAddValueChanged()" >
</
telerik:RadNumericTextBox
>
<
asp:DropDownList
runat
=
"server"
ID
=
"ddlStuAddStatus"
/>
<
script
type
=
"text/javascript"
>
function txtStudAddValueChanged(sender, eArgs) {
var numericTextBox = $find(sender.id);
var value = numericTextBox.get_value();
alert(value);
}
var numericTextBox = $find(sender.id);
5 Answers, 1 is accepted
0
![](/forums/images/avatarimages/39919b70-532f-465f-8efd-7edb2fc108a71.jpg)
Shinu
Top achievements
Rank 2
answered on 20 Dec 2013, 02:57 AM
Hi Borislava,
Please try the following JavaScript to access the RadNumericTextBox in 'txtStudAddValueChanged' event.
JavaScript:
Let me know if you have any concern.
Thanks,
Shinu.
Please try the following JavaScript to access the RadNumericTextBox in 'txtStudAddValueChanged' event.
JavaScript:
<script type=
"text/javascript"
>
function
txtStudAddValueChanged() {
var
numericTextBox = $find(
"<%=txtStuAdds.ClientID %>"
);
var
value = numericTextBox.get_value();
alert(value);
}
</script>
Let me know if you have any concern.
Thanks,
Shinu.
0
![](/forums/images/avatarimages/default.gif)
Borislava
Top achievements
Rank 1
answered on 20 Dec 2013, 12:38 PM
Getting a complier ex:
BC30451: 'txtStuAdds' is not declared. It may be inaccessible due to its protection level.
NumericTextBox inside raggrid edit template.
BC30451: 'txtStuAdds' is not declared. It may be inaccessible due to its protection level.
NumericTextBox inside raggrid edit template.
0
![](/forums/images/avatarimages/39919b70-532f-465f-8efd-7edb2fc108a71.jpg)
Shinu
Top achievements
Rank 2
answered on 21 Dec 2013, 03:14 AM
Hi Borislava,
Please try the following code snippet to access the value in the RadNumericTextBox on 'txtStudAddValueChanged event.
ASPX:
JavaScript:
Hope this will helps you.
Thanks,
Shinu.
Please try the following code snippet to access the value in the RadNumericTextBox on 'txtStudAddValueChanged event.
ASPX:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
DataSourceID
=
"SqlDataSource1"
OnItemDataBound
=
"grid1_ItemDataBound"
AutoGenerateEditColumn
=
"true"
>
<
MasterTableView
>
<
Columns
>
<
telerik:GridTemplateColumn
>
<
EditItemTemplate
>
<
telerik:RadNumericTextBox
ID
=
"txtStuAdds"
Width
=
"70px"
Value
=
"0"
runat
=
"server"
Type
=
"Number"
NumberFormat-DecimalDigits
=
"0"
Onkeyup
=
"txtStudAddValueChanged(this)"
DbValue='<%# Bind("OrderID") %>'>
</
telerik:RadNumericTextBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
JavaScript:
<script type=
"text/javascript"
>
function
txtStudAddValueChanged(sender) {
alert(sender.control.get_value());
}
</script>
Hope this will helps you.
Thanks,
Shinu.
0
![](/forums/images/avatarimages/default.gif)
Borislava
Top achievements
Rank 1
answered on 26 Dec 2013, 01:31 PM
Now I am able to get value but it's 1 value behind.
So if I enter 2 and 3 only 2 will show up .
Also how can I find a dropdownlist in order to disable based on value?
So if I enter 2 and 3 only 2 will show up .
Also how can I find a dropdownlist in order to disable based on value?
0
![](/forums/images/avatarimages/39919b70-532f-465f-8efd-7edb2fc108a71.jpg)
Shinu
Top achievements
Rank 2
answered on 27 Dec 2013, 02:52 AM
Hi Borislava,
Please have a look into the sample code snippet which works fine at my end.
ASPX:
JavaScript:
Let me know if you have any concern.
Thanks,
Shinu.
Please have a look into the sample code snippet which works fine at my end.
ASPX:
<
asp:DropDownList
runat
=
"server"
ID
=
"ddlStuAddStatus"
/>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
DataSourceID
=
"SqlDataSource1"
OnItemDataBound
=
"grid1_ItemDataBound"
AutoGenerateEditColumn
=
"true"
>
<
MasterTableView
>
<
Columns
>
<
telerik:GridTemplateColumn
>
<
EditItemTemplate
>
<
telerik:RadNumericTextBox
ID
=
"txtStuAdds"
Width
=
"70px"
Value
=
"0"
runat
=
"server"
Type
=
"Number"
NumberFormat-DecimalDigits
=
"0"
ClientEvents-OnKeyPress
=
"txtStudAddValueChanged"
DbValue='<%# Bind("OrderID") %>'>
</
telerik:RadNumericTextBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
JavaScript:
<script type=
"text/javascript"
>
function
txtStudAddValueChanged(sender, args) {
var
dropdownlist = document.getElementById(
"ddlStuAddStatus"
);
if
(args.get_keyCharacter() ==
" "
|| args.get_keyCharacter() ==
"0"
) {
dropdownlist.disabled =
true
;
}
else
dropdownlist.disabled =
false
;
alert(args.get_keyCharacter());
}
</script>
Let me know if you have any concern.
Thanks,
Shinu.