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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:34:41+00:00 2026-05-27T06:34:41+00:00

i have a grid view in the web custom control and want to select

  • 0

i have a grid view in the web custom control and want to select any row and so that i can edit that row. the edit button is on the master page and default.aspx is inherited from that master and know i want the row id on my defult page so that i can edit that row easily.

my web user control is

<asp:GridView runat="server" ID="grvBranches" GridLines="None" 
  AutoGenerateColumns="False" CellPadding="5" 
  OnRowDataBound="grvBranches_RowDataBound" 
  OnRowCancelingEdit="grvBranches_RowCancelingEdit" 
  OnRowEditing="grvBranches_RowEditing" 
  OnRowUpdating="grvBranches_RowUpdating">
    <SelectedRowStyle BackColor="#d8d8d8" />
    <HeaderStyle BackColor="#d8d8d8" />
    <Columns>
        <asp:TemplateField>
            <HeaderTemplate>
                <asp:Label Text="BranchName" ID="lblHeaderBranchName" runat="server" />
            </HeaderTemplate>
            <ItemTemplate>
                <asp:Label Text='<%# Eval("ID") %>' ID="lblID" Visible="false" runat="server" />
                <asp:Label Text='<%# Eval("Branch_Name") %>' ID="lblBranchName" runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <HeaderTemplate>
                <asp:Label Text="OrganizationName" ID="lblHeaderOrganizationName" runat="server" />
            </HeaderTemplate>
            <ItemTemplate>
                <asp:Label Text='<%# Eval("Organization_Name") %>' ID="lblOrganizationName" runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <HeaderTemplate>
                <asp:Label Text="Address" ID="lblHeaderAddress" runat="server" />
            </HeaderTemplate>
            <ItemTemplate>
                <asp:Label Text='<%# Eval("Address_1") %>' ID="lblAddress" runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <HeaderTemplate>
                <asp:Label Text="City" ID="lblHeaderCityName" runat="server" />
            </HeaderTemplate>
            <ItemTemplate>
                <asp:Label Text='<%# Eval("City_Name") %>' ID="lblCityName" runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField />
        <asp:CommandField ShowSelectButton="True" />
    </Columns>
</asp:GridView>

and i want this rowid in on my Default 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-27T06:34:42+00:00Added an answer on May 27, 2026 at 6:34 am

    On your master page .cs, on the EditButton click event

    GridView gView = ContentPlaceHolder1.FindControl("GridView1") as GridView;
    // use gView.SelectedIndex to manipulate the row, edit it, etc
    

    Assuming your main ContentPlaceHolder’s ID is ‘ContentPlaceHolder1’

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

Sidebar

Related Questions

in my web application i have grid view control with edit property true. Now
I have a custom Grid view object that inherits from the base System.Web.UI.WebControls.GridView. The
I have a Data Grid View inside a control that is displayed in a
How to implement CEditListCtrl?. List control with edit capabality (Report/Grid view). I have a
I have one grid view control in my asp.net web application. For example i
I have a grid view in web user control and I'm dynamically adding the
I have a TemplateField that is dynamically added to a custom GridView. void ITemplate.InstantiateIn(System.Web.UI.Control
I have a grid view control in my application. Please see the below code.
I have used a list view that uses a grid view in WPF. I
Is it possible to have something like Data Grid or Grid View control 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.