VB.Net DataGrid

K

Kyle

Everyone,
I am making a vb.net datagrid control, it pulls out
datatable from the Database, and here's my question:

according to specific rows from the datatable i
pulled out that were mapped to datagrid, those specific
rows will have different colors. That means, row #1 might
be yellow (according to the data from the DB), then row #2
might be red, and row #3 would be blue, and row #4 can be
red again according to the data.

I looked thru the properties of datagrid and I did
not find an appropriate way to do it.

Can someone help me out here.

Kyle,

PS: THIS IS A VB.NET USER CONTROL, NOT ASP.NET (even
though I know asp.net has a way to do it)but this must be
done in VB.NET
 
J

Jan Tielens

The SyncFusion FAQ gives an answer:
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp

5.13 How do I color a individual cell depending upon its value or some
external method?

We give three different methods for doing this.


a.. The first one overrides Paint in a derived columnstyle and sets
the backcolor there.
a.. The second uses a delegate to set the color in the Paint override.
a.. The third method adds an event to the derived column style to
allow you to set the color in an event handler.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top