Solved

Framework 2.0 DataGrid Change Row Color

Posted on 2006-11-14
5
241 Views
Last Modified: 2008-02-01
Hi,

Im trying to change the color of a row in a DataGrid object. I dont want to change it acording to values in cells, i wish to change the color of the entire row at a given time at runtime.

Im having dificulties becouse this DataGrid object doenst have the common propreties and methods i can find in a regular vb application. This code is to be used in a Device Aplication to a Pocket PC in a Mobile 5 enviorment.

Thank you in advance,
0
Comment
Question by:justaphase
  • 2
5 Comments
 
LVL 10

Expert Comment

by:Kinger247
ID: 17937483
I'm using vs2005, and to do this I would do something like :

        Dim iRow As Integer = 1
        For iCol As Integer = 0 To DataGridView.Rows(iRow).Cells.Count - 1
            DataGridView.Rows(iRow).Cells(iCol).Style.BackColor = Color.Aqua
        Next

Don't know about the pocket pc version though,
Hope this helps.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 17937907
That is DataGridView not Mobile 5 DataGrid.  I don't believe that you can achieve what you want with that DataGrid.  Unfortunately, you can't override the default behavior of the DataGridTextBoxColumn to do your own painting.

Bob
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 17938103
Just thought the idea might be the same (ish).
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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