Hi,
I am using radgrid which has two colum with radnumerictextbox . When i click the add new record i use the code block to find the radnumerictextbox after the finding i add OnKeyPress Attributes to boxes .
The Code Block above working good .
But i want to add OnKeyPress attributes like this
rntBorc.Attributes.Add("onKeyPress", "return onKeyPressBorcInsert('" + rntBorc.ClientID + "', '" + rntAlacak.ClientID + "',event);");
because i want to get character user enter ..
but the code is not working . How can i do this ??
can take OnKeyyPress function 3 arguments or more ??
I am using radgrid which has two colum with radnumerictextbox . When i click the add new record i use the code block to find the radnumerictextbox after the finding i add OnKeyPress Attributes to boxes .
if (e.Item is GridEditableItem && e.Item.IsInEditMode) | |
{ | |
if (e.Item.OwnerTableView.IsItemInserted) | |
{ | |
//item is about to be inserted | |
GridEditableItem dataItem = (GridEditableItem)e.Item; | |
RadNumericTextBox rntBorc = (RadNumericTextBox)dataItem.FindControl("tbBorc"); | |
RadNumericTextBox rntAlacak = (RadNumericTextBox)dataItem.FindControl("tbAlacak"); | |
rntBorc.Value = 0.00; | |
rntAlacak.Value = 0.00; | |
if (rntBorc != null) | |
{ | |
rntBorc.Attributes.Add("onKeyPress", "return onKeyPressBorcInsert('" + rntBorc.ClientID + "', '" + rntAlacak.ClientID + "');"); | |
} | |
if (rntAlacak != null) | |
{ | |
rntAlacak.Attributes.Add("OnKeyPress", "return onKeyPressAlacakInsert('" + rntBorc.ClientID + "', '" + rntAlacak.ClientID + "');"); | |
} | |
} | |
} |
function onKeyPressBorcInsert(rntBorcClientID, rntAlacakClientID) | |
{ | |
} | |
function onKeyPressAlacakInsert(rntBorcClientID, rntAlacakClientID) | |
{ | |
} | |
The Code Block above working good .
But i want to add OnKeyPress attributes like this
rntBorc.Attributes.Add("onKeyPress", "return onKeyPressBorcInsert('" + rntBorc.ClientID + "', '" + rntAlacak.ClientID + "',event);");
function onKeyPressBorcInsert(rntBorcClientID, rntAlacakClientID,eventArgs) | |
{ | |
var x = eventArgs.get_inputText(); | |
} |
but the code is not working . How can i do this ??
can take OnKeyyPress function 3 arguments or more ??