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 6978951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:49:26+00:00 2026-05-27T17:49:26+00:00

I think my question title is quite straight forward. Any help is appreciated..

  • 0

I think my question title is quite straight forward.

Any help is appreciated..

  • 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-27T17:49:26+00:00Added an answer on May 27, 2026 at 5:49 pm

    With BoundField and in readonly mode you can use GridView1.Rows[x].Cells[x].Text but with edit mode you have to use Controls collection to get reference of a control. This method returns a Control object.

    Control control=GridView1.Rows[x].Cells[x].Controls[0]; // later you may cast it to appropriate control class.
    

    If template field is used then you have to issue FindControl method from the Cells collection to get reference of a control based upon its ID. You may also use Cells[x].Controls collection too.

    Control control=GridView1.Rows[x].Cells[x].FindControl("ID_Of_Control"); // later you may cast it to appropriate control class.
    

    EDIT:

    It is also possible that there can be one or more controls having same name/ID across the Templatefields. In that case you can’t use FindControl method.

    Example:

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Button ID="Button1" runat="server" Text="Button" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Button ID="Button1" runat="server" Text="Button" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    

    Now to get Button and change its text from 2nd row and 1st cell:

     Button btn = GridView1.Rows[1].Cells[0].Controls[1] as Button ;
     if(btn!=null)
        btn.Text = "Hello";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The title of this question may be a bit misleading. I couldn't quite think
I think the title of the question is quite bad explained so I'll try
I think the question title is clear enough: is is possible to stable_sort() a
I think the question title seems to explain eveything. I want to detect whether
I cannot think about a proper question title to describe the problem. Hopefully the
I think I summed up the question in the title. Here is some further
Sorry for the non-technical title, but I think it summarizes my question well. If
I think I summed it up in the title. Regarding the question, I have
First, I'm sorry for the question title but I can't think of a better
I think the title for this question is probably wrong, but I'm not sure

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.