Changing color of row on DataGrid when clicked/selected

Posted on 2006-04-13
Last Modified: 2011-04-14
How can I change the color of the row when it is clicked in or selected? thanks
Question by:MikeMCSD
    1 Comment
    LVL 2

    Accepted Solution

    if you're editing your row, you'll have and sub function that selects the index to edit like this:

        Sub dgrdTime_EditCommand(ByVal s As Object, ByVal e As DataGridCommandEventArgs)
            dgrdTime.EditItemIndex = e.Item.ItemIndex

            dgrdTime.Items(dgrdTime.EditItemIndex).BackColor = Color.LightBlue
        End Sub

    Just set the backcolor there.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Article by: Kraeven
    Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    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.
    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…

    734 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

    20 Experts available now in Live!

    Get 1:1 Help Now