How to find which row in a datagrid is in focus

Posted on 2011-10-31
Last Modified: 2012-05-12
I have an ASP.NET application, i have a datagrid which has a textbox. the user can maintain focus (cursor) on a particular textbox in a row, and then click to select a value from a search window.
Upon selection the value returned should be poppulated in the textbox row that was in focus on the datagrid
Question by:countrymeister
    LVL 11

    Expert Comment


    You have to use the currentcell property of a datagrid and then after you can change the backcolor on focus event of a datagrid, so you can find which row in a datagrid is in focus.
    LVL 1

    Author Comment


    have you tried it for an ASP.NET app , because I do not see that. proeprty for datgrid .Currentcell
    I do see it available in windows forms
    LVL 14

    Accepted Solution

    Without datagrid action, we can't get the selected row index. Please fnd the attached code to get the values from all the textboxes. use this selected values and do the search

    Based on your requirement solution may vary.  you can set values in some hidden ctrl while focusing the textbox and use that for search.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now