Changing color of row on DataGrid when clicked/selected

Posted on 2006-04-13
Medium Priority
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

Accepted Solution

af4643 earned 2000 total points
ID: 16453645
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

809 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