Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6253333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:58:28+00:00 2026-05-24T13:58:28+00:00

Q: I have a gridview which contains text box as a template field.The grid

  • 0

Q:

I have a gridview which contains text box as a template field.The grid view exists in an update panel . My problem is:

When the text changed event has fired , feel like a jumpof the browser similar to the behavior of (post back).but it isn’t a post back. I don’t know why this strange behavior happened.

my aspx:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnl_research" runat="server" CssClass="pnl">
                <div id="detailsDiv" align="center" style="width: 800px;">
                    <table border="0" width="98%">
                        <tr>
                            <td align="center">
                                <div class="grid" dir="rtl">
                                    <div class="grid" dir="rtl">
                                        <div class="rounded">
                                            <div class="top-outer">
                                                <div class="top-inner">
                                                    <div class="top">
                                                        <h2>
                                                            <asp:Label ID="Label35" runat="server" Text="جدول التقييم العام"></asp:Label></h2>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="mid-outer">
                                                <div class="mid-inner">
                                                    <div class="mid">
                                                        <asp:GridView Width="100%" ID="gv_Evaluation" CssClass="datatable" AllowSorting="True"
                                                            runat="server"  AutoGenerateColumns="False" AllowPaging="True" GridLines="None"
                                                            OnRowDataBound="gv_Evaluation_RowDataBound">
                                                            <EmptyDataTemplate>
                                                                <table style="width: 100%;">
                                                                    <tr>
                                                                        <td>
                                                                        &nbsp;
                                                                    </tr>
                                                                    <tr>
                                                                        <td align="center">
                                                                            <asp:Label ID="Label4" runat="server" Font-Size="16pt" Text="&#1604;&#1575; &#1610;&#1608;&#1580;&#1583; &#1576;&#1610;&#1575;&#1606;&#1575;&#1578;"></asp:Label>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </EmptyDataTemplate>
                                                            <Columns>
                                                                <asp:TemplateField HeaderText="م">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="lblSerial" runat="server"></asp:Label></ItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:BoundField HeaderText="نوعية النشاط" DataField="activityType" />
                                                                <asp:BoundField HeaderText="أوزان النشاط" DataField="activityWeight" />
                                                                <asp:TemplateField HeaderText="التقييم">
                                                                    <ItemTemplate>
                                                                        <telerik:RadTextBox ID="txt_evaluateWeights" runat="server" AutoPostBack="True" OnTextChanged="txt_evaluateWeights_TextChanged"
                                                                            hideData='<%#((GridViewRow)Container).RowIndex%>'>
                                                                        </telerik:RadTextBox>
                                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txt_evaluateWeights"
                                                                            Display="Dynamic" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator></ItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:BoundField HeaderText="التقييم الذاتي" DataField="activitySelf" />
                                                                <asp:BoundField HeaderText="تقييم رئيس القسم" DataField="activityBoss" />
                                                                <asp:BoundField HeaderText="تقييم العميد" DataField="activityDean" />
                                                            </Columns>
                                                            <RowStyle VerticalAlign="Top" CssClass="row" />
                                                        </asp:GridView>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="bottom-outer">
                                                <div class="bottom-inner">
                                                    <div class="bottom">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>

EDIT:

I remove

this line hideData='<%#((GridViewRow)Container).RowIndex%>'


 protected void txt_evaluateWeights_TextChanged(object sender, EventArgs e)
        {

            calc();
            int index = ((System.Web.UI.WebControls.GridViewRow)(((RadTextBox)sender).Parent.NamingContainer)).DataItemIndex;
            //int index = int.Parse(((RadTextBox)sender).Attributes["hideData"]);
            ((RadTextBox)gv_Evaluation.Rows[index + 1].Cells[3].FindControl("txt_evaluateWeights")).Focus();
        }

still the same problem!!


EDIT2:

 protected void gv_Evaluation_RowDataBound(object sender, GridViewRowEventArgs e)
    {

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Label lblSerial = (Label)e.Row.FindControl("lblSerial");
            lblSerial.Text = ((gv_Evaluation.PageIndex * gv_Evaluation.PageSize) + e.Row.RowIndex + 1).ToString();

            RadTextBox txt = e.Row.FindControl("txt_evaluateWeights") as RadTextBox;
            ScriptManager.GetCurrent(this).RegisterAsyncPostBackControl(txt);  
        }


    }

still the same problem!!


EDIT3:

I knew the problem , but i don’t know how to fix it:

the problem is as a result of this line:

 ((RadTextBox)gv_Evaluation.Rows[index + 1].Cells[3].FindControl("txt_evaluateWeights")).Focus();

but i need this line of code. How to prevent the Focus() method from making a jump to the top of the page.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:58:28+00:00Added an answer on May 24, 2026 at 1:58 pm

    Are you sure this is not a Postback? You should define your triggers.

    I believe this might be a similar problem, with a solution:
    Full postback triggered by LinkButton inside GridView inside UpdatePanel

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gridview which contains a text box as a template field.the grid
I have a grid view which contains a button in a template field. I
i have a grid-view, which contains an asp image-button for deleting row, i want
I have a grid view which contains some sequence numbers. Each column needs to
I have a asp:GridView which contains a asp:TextBox within a TemplateField. I would like
I have a form that contains a GridView control which is databound to an
I have a gridview to which I have created an Insert Template in the
Hello I have created and application which contains a gridview that is populated by
A typical situation: In my GridView control, I have a Footer row which contains
I have a gridview in which itemtemplate contains hiddenfield.I have a button outside gridview.In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.