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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:29:33+00:00 2026-05-22T21:29:33+00:00

Code: <asp:GridView ID=gv_Recruit AutoGenerateColumns=False Width=100% runat=server OnRowCreated=gvStates_RowCreated OnRowDataBound=gvStates_RowCreated> <Columns> <asp:BoundField HeaderText=key DataField=key /> <asp:BoundField

  • 0

Code:

    <asp:GridView ID="gv_Recruit" AutoGenerateColumns="False" Width="100%"
     runat="server" OnRowCreated="gvStates_RowCreated" 
        OnRowDataBound="gvStates_RowCreated">
  <Columns>
    <asp:BoundField HeaderText="key" DataField="key" />
    <asp:BoundField HeaderText="Name" DataField="Name" />
    <asp:BoundField HeaderText="Quota" DataField="Quota" />
    <asp:BoundField HeaderText="Session" DataField="Sess" >
      <ItemStyle HorizontalAlign="Center" />
      </asp:BoundField>
    <asp:TemplateField HeaderText="">
      <ItemTemplate>
        <asp:DropDownList ID="ddlCities" Width="100%" AutoPostBack="true" runat="server" OnSelectedIndexChanged="ddl_selected">
        </asp:DropDownList>
      </ItemTemplate>
    </asp:TemplateField>
    <asp:BoundField HeaderText="Recruiter" DataField="Recruiter" />
    <asp:BoundField HeaderText="MN Phone" DataField="MN Phone" />
    <asp:BoundField HeaderText="Cell Phone" DataField="Cell Phone" />
  </Columns>
</asp:GridView>

Code Behind:

protected void ddl_selected(object sender, EventArgs e)
{
    string _dd_value = ((DropDownList)sender).SelectedValue;
    string trying_to_get = gv_Recruit.Rows[???].Cells[0].Text.ToString(); 
    string also_tried = gv_Recruit.SelectedRow.Cells[0].Text.ToString();
}

Basically what I’m trying to do is get the key value from the first row when the drop down is changed so I can perform an update ???

Can’t figure this out.

Thanks in advance for the help…

  • 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-22T21:29:33+00:00Added an answer on May 22, 2026 at 9:29 pm

    Try

     GridViewRow gRow = (GridViewRow)(sender as Control).Parent.Parent;
     string trying_to_get = string.Empty;
     if (gRow != null) 
     {
        trying_to_get = gRow.Cells[0].Text;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my ASP code: <asp:GridView ID=WagerTable runat=server AutoGenerateColumns=False CssClass=basix > <columns> <asp:BoundField DataField=GameName
1 My gridview code is like: <asp:GridView runat=server ID=gvOpenProblems AutoGenerateColumns=true BorderColor=Black OnRowCreated=gvOpenProblems_RowCreated OnRowDataBound=gvOpenProblems_RowDataBound HeaderStyle-HorizontalAlign=Center
I have this code <asp:GridView ID=gvCentersList runat=server AutoGenerateColumns=False DataKeyNames=CenterID DataSourceID=SqlDataSource1 CssClass=gv-classic> <Columns> <asp:TemplateField HeaderText=>
Here is the code: <asp:GridView ID=MyGridView runat=server> <Columns> <asp:BoundField Text=Name DataField=Name /> <asp:TemplateField HeaderText=Delete>
Why ItemStyle-VerticalAlign=Middle not work in asp:GridView?, this is my code <asp:GridView ID=GridView1 runat=server RowStyle-VerticalAlign=Middle
If I have the following (generic) ASP code: <asp:ObjectDataSource runat=server ID=myODS>...</asp:ObjectDataSource> <asp:GridView runat=server ID=myGV
I have a gridview as follows: <asp:GridView ID=gv runat=server SelectMethod=gv_GetData AllowPaging=true AllowSorting=true AutoGenerateColumns=true> </asp:GridView>
I use this code to invoke a GridView: <asp:GridView runat=server ID=detailView AutoGenerateEditButton=true OnRowEditing=EditRow OnRowCancelingEdit=CancelEdit
Here is a code for my web form control <asp:TextBox runat=server ID=txtUsername></asp:TextBox> <asp:RequiredFieldValidator ID=RequiredFieldValidator1
I have the following structure in an aspx page: <asp:Panel ID=pnlCust runat=server> <asp:GridView ID=gvMaster

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.