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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:58:12+00:00 2026-05-18T09:58:12+00:00

Hey I have a gridView and I would like to extract the PhotoPath (ftppath

  • 0

Hey I have a gridView and I would like to extract the PhotoPath (ftppath + filename (ftp://192.168.1.2/Jelly.jpg))

its in asp.net and I’m not sure how to retrieve the data ive set the gridView up for selection and I like to “upon” select store the PhotoPath in a string.

source

<asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
        AutoGenerateColumns="False" DataKeyNames="StudentID" 
        DataSourceID="SqlDataSource1" Height="263px" Width="915px" 
        AllowPaging="True" CellPadding="4" ForeColor="#333333" GridLines="None" 
        onselectedindexchanged="GridView1_SelectedIndexChanged">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                ShowSelectButton="True" />
            <asp:BoundField DataField="No" HeaderText="MatricNo" 
                SortExpression="MatricNo" />
            <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                SortExpression="FirstName" />
            <asp:BoundField DataField="LastName" HeaderText="LastName" 
                SortExpression="LastName" />
            <asp:BoundField DataField="Current" HeaderText="CurrentModules" 
                SortExpression="CurrentModules" />
            <asp:BoundField DataField="PhotoPath" HeaderText="PhotoPath" 
                SortExpression="PhotoPath" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" BorderColor="Blue" BorderStyle="Solid" 
            Font-Size="Small" />
        <SelectedRowStyle BackColor="#D1DDF1" BorderStyle="Solid" Font-Bold="True" 
            Font-Size="Small" ForeColor="#333333" HorizontalAlign="Center" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>

I tryed this:

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        string PhotoPath;
        GridView1.CurrentRow.Cells[0].Value.ToString();
    }

But current row isn’t part of the definition.

  • 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-18T09:58:13+00:00Added an answer on May 18, 2026 at 9:58 am

    Try with

    protected void GridView1_SelectedIndexChanging(object sender, EventArgs e) {
        string PhotoPath = "";
        // Get the currently selected row. Because the SelectedIndexChanging event
        // occurs before the select operation in the GridView control, the
        // SelectedRow property cannot be used. Instead, use the Rows collection
        // and the NewSelectedIndex property of the e argument passed to this 
        // event handler.
        GridViewRow row = GridView1.Rows[e.NewSelectedIndex];
    
        PhotoPath = row.Cells[5].Text;
    }
    

    or

    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) {
        string PhotoPath = "";
        GridViewRow row = GridView1.SelectedRow;
    
        PhotoPath = row.Cells[5].Text;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey I have an XML file and I would like to navigate to a
Hey guys, I have a GridView which is binded to SqlDataSource, everything works fine,
Hey I have following code like this public object RetrieveItemRun(int item) { if (dictionary.ContainsKey(item))
Hey guys I have a gridview and below it 4 textboxes I'm using to
Hey I have a function which is called from a html link like this:
Hey I have an abstract class named Partition which is a functor, and its
Hey so I have a gridview as follows <asp:GridView ID=productListTable runat=server DataSourceID=srcProductListPerCustomer AutoGenerateColumns=False AlternatingRowStyle-CssClass=tr_dark
hey guys, i have a gridview which displays 10records per page, now i want
Hey so I have a stored procedure populating a gridview and in my stored
Hey have method called voted? that sees if someone voted. Where would I put

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.