3 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 03 Mar 2009, 11:26 AM
Hello Nabil,
You can check out the following code library submission which demonstrates on how to access controls placed in templates inside the grid on the client:
Accessing server controls in a grid template on the client
Thanks
Princy.
You can check out the following code library submission which demonstrates on how to access controls placed in templates inside the grid on the client:
Accessing server controls in a grid template on the client
Thanks
Princy.
0
Nabil
Top achievements
Rank 1
answered on 03 Mar 2009, 12:12 PM
Thanks for the prompt reply. This is nice approach to get clientid. But what if I want to get the clientid of the control in the next column? Means i want to show the sum of column 1 and 2 in third column. Calculation will be made on onblur or onchange event of first two columns. That is when user write text in textbox and focus out of the control then calculation will be made by adding value of first column and second column.
0
Hello Nabil,
Test the following:
Hope this helps.
Best regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Test the following:
<script type="text/javascript" language="javascript"> |
function changeValue(sender, args) |
{ |
var row = sender.get_element().parentNode.parentNode.parentNode; |
var inputs = row.getElementsByTagName("input"); |
for (var i = 0; i < inputs.length; i++) |
{ |
if (inputs[i].id.match("rtb2$")) |
$find(inputs[i].id).set_value("10"); |
} |
} |
</script> |
<telerik:GridTemplateColumn UniqueName="Col1"> |
<EditItemTemplate> |
<telerik:RadTextBox ID="rtb1" ClientEvents-OnFocus="changeValue" runat="server" /> |
</EditItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn UniqueName="Col2"> |
<EditItemTemplate> |
<telerik:RadTextBox ID="rtb2" runat="server" /> |
</EditItemTemplate> |
</telerik:GridTemplateColumn> |
Hope this helps.
Best regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.