title: How to keep focus on the text box after text changed event
body: <p>I have a gridview which contains a text box as a template field.the grid view is in an updatepanel.</p>
  
  <p>I use the text changed event to to calculate the percentage of the first four textboxes and put the result in the fifth text box , My problem is: i always lose the focus as soon as the text changed ,and every time i was supposed to move the mouse cursor again to the target text box.How to solve this problem?I wanna to keep the focus on my text box after text changed.</p>
  
  <p>My Code:</p>
  
  <pre><code> private void calc()
          {
              float sum = 0;
              for (int i = 0; i &lt; 7; i++)
              {
                  RadTextBox txt1 = (RadTextBox)gv_Evaluation.Rows[i].Cells[3].FindControl("txt_evaluateWeights");
                  int weight;
                  bool result = Int32.TryParse(txt1.Text, out weight);
                  if (result)
                  {
                      sum += weight;
                  }
              }
  
              double percentage;
              percentage = Math.Round((sum / 100) * 100, 2);
              RadTextBox txt3 = (RadTextBox)gv_Evaluation.Rows[7].Cells[3].FindControl("txt_evaluateWeights");
              txt3.Text = percentage.ToString();//string.Format("{0:0.0%}", percentage.ToString());
  
          }
  </code></pre>
  
  <hr>
  
  <pre><code>       protected void txt_evaluateWeights_TextChanged(object sender, EventArgs e)
  
          {
              calc();
          }
  </code></pre>
  
  <hr>
  
  <p>My aspx:</p>
  
  <pre><code>&lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
          &lt;ContentTemplate&gt;
              &lt;asp:Panel ID="pnl_research" runat="server" CssClass="pnl"&gt;
                  &lt;div id="detailsDiv" align="center" style="width: 800px;"&gt;
                      &lt;table border="0" width="98%"&gt;
                          &lt;tr&gt;
                              &lt;td align="center"&gt;
                                  &lt;asp:Panel ID="panel_rmv" runat="server" Visible="true" Direction="RightToLeft"&gt;
                                      &lt;div class="grid" dir="rtl"&gt;
                                          &lt;div class="grid" dir="rtl"&gt;
                                              &lt;div class="rounded"&gt;
                                                  &lt;div class="top-outer"&gt;
                                                      &lt;div class="top-inner"&gt;
                                                          &lt;div class="top"&gt;
                                                              &lt;h2&gt;
                                                                  &lt;asp:Label ID="Label35" runat="server" Text="##"&gt;&lt;/asp:Label&gt;&lt;/h2&gt;
                                                          &lt;/div&gt;
                                                      &lt;/div&gt;
                                                  &lt;/div&gt;
                                                  &lt;div class="mid-outer"&gt;
                                                      &lt;div class="mid-inner"&gt;
                                                          &lt;div class="mid"&gt;
                                                              &lt;asp:GridView Width="100%" ID="gv_Evaluation" CssClass="datatable" AllowSorting="True"
                                                                  runat="server" TabIndex="2" AutoGenerateColumns="False" AllowPaging="True" GridLines="None"
                                                                  OnRowDataBound="gv_Evaluation_RowDataBound"&gt;
                                                                  &lt;EmptyDataTemplate&gt;
                                                                      &lt;table style="width: 100%;"&gt;
                                                                          &lt;tr&gt;
                                                                              &lt;td&gt;
                                                                              &amp;nbsp;
                                                                          &lt;/tr&gt;
                                                                          &lt;tr&gt;
                                                                              &lt;td align="center"&gt;
                                                                                  &lt;asp:Label ID="Label4" runat="server" Font-Size="16pt" Text="&amp;#1604;&amp;#1575; &amp;#1610;&amp;#1608;&amp;#1580;&amp;#1583; &amp;#1576;&amp;#1610;&amp;#1575;&amp;#1606;&amp;#1575;&amp;#1578;"&gt;&lt;/asp:Label&gt;
                                                                              &lt;/td&gt;
                                                                          &lt;/tr&gt;
                                                                          &lt;tr&gt;
                                                                              &lt;td&gt;
                                                                                  &amp;nbsp;
                                                                              &lt;/td&gt;
                                                                          &lt;/tr&gt;
                                                                      &lt;/table&gt;
                                                                  &lt;/EmptyDataTemplate&gt;
                                                                  &lt;Columns&gt;
                                                                      &lt;asp:TemplateField HeaderText="م"&gt;
                                                                          &lt;ItemTemplate&gt;
                                                                              &lt;asp:Label ID="lblSerial" runat="server"&gt;&lt;/asp:Label&gt;
                                                                          &lt;/ItemTemplate&gt;
                                                                      &lt;/asp:TemplateField&gt;
                                                                      &lt;asp:BoundField HeaderText="" DataField="activityType" /&gt;
                                                                      &lt;asp:BoundField HeaderText="" DataField="activityWeight" /&gt;
                                                                      &lt;asp:TemplateField HeaderText=""&gt;
                                                                          &lt;ItemTemplate&gt;
                                                                              &lt;telerik:RadTextBox ID="txt_evaluateWeights" runat="server" AutoPostBack="True" OnTextChanged="txt_evaluateWeights_TextChanged"&gt;
                                                                              &lt;/telerik:RadTextBox&gt;
                                                                          &lt;/ItemTemplate&gt;
                                                                      &lt;/asp:TemplateField&gt;
                                                                      &lt;asp:BoundField HeaderText="" DataField="activitySelf" /&gt;
                                                                      &lt;asp:BoundField HeaderText="" DataField="activityBoss" /&gt;
                                                                      &lt;asp:BoundField HeaderText="" DataField="activityDean" /&gt;
                                                                  &lt;/Columns&gt;
                                                                  &lt;RowStyle VerticalAlign="Top" CssClass="row" /&gt;
                                                              &lt;/asp:GridView&gt;
                                                          &lt;/div&gt;
                                                      &lt;/div&gt;
                                                  &lt;/div&gt;
                                                  &lt;div class="bottom-outer"&gt;
                                                      &lt;div class="bottom-inner"&gt;
                                                          &lt;div class="bottom"&gt;
                                                          &lt;/div&gt;
                                                      &lt;/div&gt;
                                                  &lt;/div&gt;
                                              &lt;/div&gt;
                                          &lt;/div&gt;
                                  &lt;/asp:Panel&gt;
                              &lt;/td&gt;
                          &lt;/tr&gt;
                      &lt;/table&gt;
                  &lt;/div&gt;
              &lt;/asp:Panel&gt;
          &lt;/ContentTemplate&gt;
      &lt;/asp:UpdatePanel&gt;
  </code></pre>