Remove an item from a datagrid on binding

  • Thread starter Thread starter A Traveler
  • Start date Start date
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.
 
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.
 
Back
Top