Remove an item from a datagrid on binding

Discussion in 'ASP .Net Web Controls' started by A Traveler, Oct 4, 2004.

  1. A Traveler

    A Traveler Guest

    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.
     
    A Traveler, Oct 4, 2004
    #1
    1. Advertising

  2. 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" <> 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.
    >
    >
     
    W.G. Ryan eMVP, Oct 4, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    0
    Views:
    339
  2. ssoss

    Display Related Item or Add Item

    ssoss, Sep 17, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    518
    ssoss
    Sep 19, 2003
  3. gce

    Tabstrip with remove item

    gce, Mar 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,301
    Jason Bentley
    Mar 28, 2005
  4. QUASAR
    Replies:
    6
    Views:
    461
    QUASAR
    Jan 17, 2004
  5. A Traveler

    Remove an item from a datagrid on binding

    A Traveler, Oct 4, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    117
    W.G. Ryan eMVP
    Oct 4, 2004
Loading...

Share This Page