Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

Assign specific gridview at run time

$
0
0

Not sure if this is possible, I have done some Google work but have not found an answer. Here is what I want to do.

I have 31 gridviews (one for each day of the month), I want to run a sub on each one, for simplicity lets say I wanted to change the backcolor of the first row (I don't I want to do some more things in the sub but that's not important as you will see).

In words it would look like this

Gridview1 New row created event handler

Backcolor Sub()

End sub

Gridview2 New row created event handler

Backcolor Sub()

End sub

etc etc.... through to 31

Then the Sub would look something like this...

Sub - Backcolor()

For N = 0 to 30

Gridview (N).cells(0).rows(0).backcolor.drawing.color.red

Next N

The specifics of the code for backcolor etc,. are fine, I can deal with that, the key issue is Gridview (n), is it possible to use a variable to decide which gridview you want to work with? - if so what is that syntax

Of course its very possible I am approaching this in totally the wrong way, if you have another route to the same aim then please let me know.

Thanks in advance as ever for your thoughts.

regards

Peter


Viewing all articles
Browse latest Browse all 3509

Trending Articles