Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGridView Binding

Status
Not open for further replies.

jbenson001

Programmer
Jan 7, 2004
8,172
US
Hello all,

I am new to VB.NET. Actually I develop in ASP.NET 1.1 and 2.0 using VB.NET.
I have a question about the DataGridView. I am trying to find an event that will give me access to each row as it is being bound. For example, in ASP.NET I would use the RowDataBoundEvent. Then in that event I could do something like.

e.Row.Cells(1).Text .. to get the text in the second column.

What is the equivilant in VB.NET? There are so many events, many more than in ASP, however, I don't find one to do what I want. The Rows_Added event only triggers on the first row, not all rows.

Any help would be appreciated. Thanks in advance...

Jim
 
It depends what you want to do Jim. There is a CellFormatting method that will fire for each cell (for example, if you wanted to do some conditional formatting on a particular row/cell).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Well I was wondering if there is an equialent event that fires for each row.. as it binds.. or do i have to go down to cell level.
It just ticks me off that the controls are so different. I know it is 2 diff technologies.. but the ASP grid has great GUI to set it up but less events. Windows GUI sucks for the grid but has tons(too many i think) events.

Anyway, enough of my complaining. Is there an event similar to the RowDataBoundEvent? Let's say so I can examine the row, and pull values from columns?

Thanks ca8msm
 
I've not delved into it too much myself but from what I can gather there isn't an equivilant function (someone will correct me if I'm wrong!). You can definately do what you want from the event I mentioned below though.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Jim
There was a thread on a similar line a couple of days ago. Have a look at thread796-1194465 for pointers.


Sweep
...if it works, you know the rest..
curse.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top