This is a migrated thread and some comments may be shown as answers.

[Solved] Accessing Template column in RadGrid

2 Answers 161 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nirmal
Top achievements
Rank 1
Nirmal asked on 24 Jul 2009, 04:13 AM
Hi,

I have a RAD grid with template columns, with in template columns i have two numeric textbox. On Client side i have to give input to one numeric textbox and set some calculation in another numeric textbox..
Pls help me as soon as possible. 

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Jul 2009, 06:41 AM
Hi Nirmal,

Try the following code snippet and see whether it helps.

ASPX:
 
<telerik:GridTemplateColumn UniqueName="CheckBoxCol"  HeaderText="TempColumn" > 
              <ItemTemplate> 
                  <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" onBlur="Blur(this);" > 
                  </telerik:RadNumericTextBox> 
                  <telerik:RadNumericTextBox ID="RadNumericTextBox2" runat="server"
                  </telerik:RadNumericTextBox> 
              </ItemTemplate> 
         </telerik:GridTemplateColumn> 


JS:
 
<script type="text/javascript"
 function Blur(RadNumTxtbx1) 
 { 
  
   var rowIndex=RadNumTxtbx1.parentNode.parentNode.parentNode.sectionRowIndex; 
   var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView(); 
   var RadNumTxtbx2=masterTable.get_dataItems()[rowIndex].findControl("RadNumericTextBox2"); 
   var result=parseInt(RadNumTxtbx1.value) + 2; 
   RadNumTxtbx2.set_value(result); 
 } 
  
  
</script> 


Best Regards
Princy
0
Nirmal
Top achievements
Rank 1
answered on 24 Jul 2009, 09:30 AM
Thanks princy,

But Im using Q1 2008 version it shows script error :object doesn't support this property or method and
 One more doubt.   I have Numerictextbox in invisible template column how can i get this value through clientside. 
Tags
Grid
Asked by
Nirmal
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Nirmal
Top achievements
Rank 1
Share this question
or