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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:32:00+00:00 2026-06-08T07:32:00+00:00

I have a grid like below. <asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False s onrowcommand=GridView1_RowCommand> <Columns> <asp:ButtonField

  • 0

I have a grid like below.

 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" s                                      
                                    onrowcommand="GridView1_RowCommand">
  <Columns>
      <asp:ButtonField DataTextField="Name" HeaderText="Name" />
      <asp:BoundField DataField="ArrDate" DataFormatString="{0:MM/dd/yyyy}" 
                              HeaderText="Arr Date" />
      <asp:BoundField HeaderText="Dep Date" DataField="DepDate" 
                           DataFormatString="{0:MM/dd/yyyy}" />
      <asp:BoundField HeaderText="Mail" DataField="Mail" />
      <asp:BoundField HeaderText="Status" DataField="Status" />
      <asp:BoundField DataField="ResId" HeaderText="ResId" Visible="False" />                                        
  </Columns>
</asp:GridView>

In Code Behind:-

try
{
  string text = GridView1.Rows[2].Cells[5].Text;
  ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('ResId = " + text  + ".');", true);             
}
catch { }

Now the message shows – RegId =.

I can’t get the value. So I change the RedId BoundField as vissible. Now I got the Value.

that is RegId =6.

I have two issue now –

1) How to get the RegId value in Non Visible Column.
2) How I find the Row value which i click… bzs the only i can change the ROWVALUE in code..

 string text = GridView1.Rows[ROWVALUE].Cells[5].Text;
  • 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-08T07:32:01+00:00Added an answer on June 8, 2026 at 7:32 am

    That is certainly not the right way to do it. You might want to look at using DataKeys to achieve this. With current approach, when you add a new column to your grid your code will fail.

    1. Add your RegId column inside DataKeys property on your gridview
    2. Reference your gridview datakey for the current row in codebehind like this

       int regId= Convert.ToInt32(YourGridview.DataKeys[rowIndex]["RegId"].ToString());
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gridview like below: <asp:GridView DataKeyNames=TransactionID AllowSorting=True AllowPaging=TrueID=grvBrokerage runat=server AutoGenerateColumns=False CssClass=datatable Width=100%
I have an ext js grid like below: var grid = new Ext.grid.GridPanel({ columns:
I have an ASP.NET GridView which has columns that look like this: | Foo
I have grid something like this: Ext.define('Exp.view.dashboard.Tv', { extend: 'Ext.grid.Panel', initComponent: function() { this.columns
I have gridview in my asp.net 3.5 application [C#]. Which looks like this: <asp:GridView
I have a Grid that looks something like the simplified example showed below. There
I have some xaml code for a silverlight project sort of like below: <Grid>
I have a RadComboBox that i have bound like shown below <telerik1:RadComboBox Grid.Row=2 Grid.Column=1
i have a grid and adding elements to is in jquery like below: $('#MyGrid
I currently have an ASP.NET GridView that displays a few columns to the user

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.