Hello Sir /Madam,
Currently i am using rad grid in my project now i am using asp text box control inside the item template of rad grid now i Have to check all Textboxes text at client side and apply Validation on it if all text boxes text is empty then validation message should be shown. here is my screen shot that i have attached named (TextBox_inside_grid) in this screen shot if i dont write any text in any text box than at button click message Should be display and if i click on cancel button than all validation messages show be hide and if any text is inside the textboxes it should also be clear. Currently i am writing this code:
function Materialreceived_ClientClick1() {
var count = 0;
var grid = $find("<%=RadGrid_POPUP_MaterialReceived.ClientID %>");
var MasterTable = grid.get_masterTableView();
for (var i = 0; i < MasterTable.get_dataItems().length; i++) {
var gridItemElement = MasterTable.get_dataItems()[i].findElement("txt_receivedqty");
var lenght = ((gridItemElement).val());
if (lenght>0) {
count++;
break;
}
}
if (count == 0) {
alert("Please check atleast one !");
document.getElementById("<%=lblgrid.ClientID %>").innerHTML = 'User must enter a number on at least one row.';
return false;
}
}
But its not working. so please tell me asap.
thanks in advance
Currently i am using rad grid in my project now i am using asp text box control inside the item template of rad grid now i Have to check all Textboxes text at client side and apply Validation on it if all text boxes text is empty then validation message should be shown. here is my screen shot that i have attached named (TextBox_inside_grid) in this screen shot if i dont write any text in any text box than at button click message Should be display and if i click on cancel button than all validation messages show be hide and if any text is inside the textboxes it should also be clear. Currently i am writing this code:
function Materialreceived_ClientClick1() {
var count = 0;
var grid = $find("<%=RadGrid_POPUP_MaterialReceived.ClientID %>");
var MasterTable = grid.get_masterTableView();
for (var i = 0; i < MasterTable.get_dataItems().length; i++) {
var gridItemElement = MasterTable.get_dataItems()[i].findElement("txt_receivedqty");
var lenght = ((gridItemElement).val());
if (lenght>0) {
count++;
break;
}
}
if (count == 0) {
alert("Please check atleast one !");
document.getElementById("<%=lblgrid.ClientID %>").innerHTML = 'User must enter a number on at least one row.';
return false;
}
}
But its not working. so please tell me asap.
thanks in advance