Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Remove an item from a datagrid on binding

Reply
Thread Tools

Remove an item from a datagrid on binding

 
 
A Traveler
Guest
Posts: n/a
 
      10-04-2004
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.


 
Reply With Quote
 
 
 
 
W.G. Ryan eMVP
Guest
Posts: n/a
 
      10-04-2004
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.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"A Traveler" <hitchhikersguideto-> wrote in message
news:%...
> 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.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get data from parent datagrid item from child datagrid dataitem Skowronek ASP .Net 4 12-04-2007 07:34 PM
Remove an item from a datagrid on binding A Traveler ASP .Net Datagrid Control 1 10-04-2004 03:16 PM
How to know if a datagrid item will be displayed in a datagrid with pagging CFirmino ASP .Net Datagrid Control 1 04-04-2004 12:39 AM
Change style of a single row of the item list of datagrid, based on a field value of current item... QUASAR ASP .Net Datagrid Control 6 01-17-2004 07:46 PM
Preventing a datagrid item from binding John ASP .Net 0 07-07-2003 08:38 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57