Remove an item from a datagrid on binding

A

A Traveler

Hello, i have a datagrid which i have set up so it has "Accounting" style
formating (alternating items with a different backcolor). There are a few
rows which the client wanted removed. This is no problem to do, however the
rows still count into the sequence for
item,alternateitem,item,alternateitem. So i wind up with two alternateitems
next to each other and the accounting highlighting sequence gets thrown off.

How can i actually get rid of the row so it is completely out of the
sequencing?

Thanks in advance,
Arthur Dent.
 
W

W.G. Ryan eMVP

Remove them right before you call DataBind() and/or specify the datasource.
I'm not sure what event sequence you are using but just as a FYI, calling
..Delete doesn't remove the rows from the collection until AcceptChanges is
called so depending on whether your calling Delete or Remove - this could be
an issue as well.
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top