c# multiple datagridviews - set to only focus on one datagridview at a time

Posted on 2007-10-04
Last Modified: 2013-12-17
I have a c# (visual studio 2005) WINDOWS application.  Inside the application I have a usercontrol with multiple datagridviews.  I would like to set it up in such a way that the blue selection bar will only be on one datagridview at a time.  For instance - if it was on datagridview A row 3 and I selected datagridview B row 2, the blue bar would no longer be on datagridview A and would now be on datagridview B row 2.  Thanks
Question by:tolninja
    LVL 5

    Accepted Solution

    Use DataGrid1.SelectedItem = -1 in one of the other datagrid events like click
    LVL 1

    Author Comment

    Good idea.  Only the syntax you listed doesn't work.  I have no *.selecteditem.  Please advise.
    LVL 5

    Assisted Solution

    that was web sorry

    LVL 1

    Author Comment

    haha.  I got it at the exact same time you did.  thanks for the help.  This works great.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 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

    9 Experts available now in Live!

    Get 1:1 Help Now