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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:02:58+00:00 2026-06-17T10:02:58+00:00

I have a GridView – <asp:GridView ID=table_example Runat=server DataSourceID=SqlDataSource3 AutoGenerateColumns=False ClientIDMode=Static onprerender=table_example_PreRender> <Columns> <asp:TemplateField>

  • 0

I have a GridView –

<asp:GridView ID="table_example" Runat="server" 
DataSourceID="SqlDataSource3" AutoGenerateColumns="False" 
ClientIDMode="Static" onprerender="table_example_PreRender">
    <Columns>
        <asp:TemplateField>
     <HeaderTemplate>
         <asp:Label ID="Label1" runat="server" Text="Select"></asp:Label>

     </HeaderTemplate>
     <ItemTemplate>
        <asp:CheckBox ID="chkRow" runat="server" OnCheckedChanged="CheckBoxPN_CheckedChanged" AutoPostBack="true"/>
     </ItemTemplate>
  </asp:TemplateField>
        <asp:BoundField HeaderText="profileID" DataField="profileID" 
                        SortExpression="profileID"></asp:BoundField>
        <asp:BoundField HeaderText="profileName" DataField="profileName" 
                        SortExpression="profileName"></asp:BoundField>
    </Columns>
</asp:GridView>

Where the code behind for chkRow–

protected void CheckBoxPN_CheckedChanged(Object sender, EventArgs e)
    {
        CheckBox chk = (CheckBox)sender;
        GridViewRow row = (GridViewRow)chk.NamingContainer; 

        //when a user clicks the checkbox I need the string from profileName in that row. 

    }

On debugging I can get to the checkBox changed event, however need to retrieve the string from the profileName cell from its respective row cell.

I tried something like this –

string c = row.Cells("profileName").value.toString();

However this did not work, how can I get the string?

  • 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-06-17T10:02:59+00:00Added an answer on June 17, 2026 at 10:02 am

    If you use a BoundField you need to use Cells[index].Text. Since it’s in the third column:

    string profileName = row.Cells[2].Text;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have GridView: <asp:GridView ID=MyGridView runat=server ShowFooter=true AutoGenerateColumns=False Visible=True> <Columns> <asp:BoundField DataField=id ItemStyle-HorizontalAlign=center/> <asp:BoundField
I have Gridview which uses this SqlDataSource as DataSource <asp:SqlDataSource ID=dsMetal runat=server ConnectionString=<%$ConnectionStrings:connStr%> SelectCommand=select
I have my GridView populating like so: <asp:Panel ID=pnlGrid runat=server> <div class=m_container style=margin-bottom:20px;> <asp:GridView
I have GridView and Button controls nested inside a Panel . <asp:Panel ID=PanelPopUp runat=server>
I have gridview in my asp.net 3.5 application [C#]. Which looks like this: <asp:GridView
I am using asp.net (3.5). I have GridView and I need to use Drag&Drop
I have a GridView with a row number (Container.DataItemIndex) column in ASP.NET (1,2,3,4, ...)
i have followed GridView in my ASP.Net Page: http://s2.imgimg.de/uploads/14b706b38JPG.jpg It should look like this:
I have GridView with Template Column.Inside the template column i have asp:hiddenfield. I am
I have a GridView control on my ASP.NET page that binds to result set

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.