Change the color of grid view for 2 rows of set

Posted by Pallubhosale under VB.NET on 2/19/2014 | Points: 10 | Views : 754 | Status : [Member] | Replies : 3
Hi,

I want to change the Background color of GridView according to different serial no. eg in below grid there r 2 rows for 1 serial no. I want to add differant color for new serial no.
e.g for s/n 002 color=gray and for s/n 004 color white. I am tryind but i am able to change for alternating row not acoording to serial no.


__________________
s/n | Dir| Bus No|
____|____|_______|
002 | 1 | 77345 |
----|----|-------|
| 4 | 78954 |
----|----|-------|
004 | 5 | 7897 |
----|----|-------|
| 1 | 67895 |
----|----|-------|
007 | 3 | 67843 |
----|----|-------|
| 2 | 54321 |
----|----|-------|

Thanks

Pallavi


Responses

Posted by: Pallubhosale on: 2/19/2014 [Member] Starter | Points: 25

Up
0
Down
s/n | Dir| Bus No|
____|____|_______|
002 | 1 | 77345 |
----|----|-------|
002 | 4 | 78954 |
----|----|-------|
004 | 5 | 7897 |
----|----|-------|
004 | 1 | 67895 |
----|----|-------|
007 | 3 | 67843 |
----|----|-------|
007| 2 | 54321 |
----|----|-------|

This is the grid viw format
I am not able to draw table in proper format 002,004 ,007 is serial no and 4,5,1,3,2, is dir coloum it is mixing ..
s/n dir bus no
-----------------------
002 2 2344657
------------------------
002 4 3437935
------------------------
004 1 567789
------------------------
004 3 678932
-------------------------
001 2 23459
----------------------
001 2 678923
________________________




Pallavi

Pallubhosale, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 2/19/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
This link might help you..
http://www.aspsnippets.com/Articles/Dynamically-change-GridView-Row-Background-Color-based-on-condition-in-ASPNet-using-C-and-VBNet.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Pallubhosale, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 2/19/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
http://www.dreamincode.net/forums/topic/329795-datagridview-row-change-color/
http://www.dotnetspark.com/tutorial/21-74-change-background-color-row-gridview-based.aspx

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Pallubhosale, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response