hide or remove a row from datagrid

Discussion in 'ASP .Net Datagrid Control' started by Samson, Jun 3, 2004.

  1. Samson

    Samson Guest

    I have a datagrid bound to an employee database table, which looks
    something like this:

    FirstName LastName PhoneNumber Email
    ---------------------------------------------
    John Baggins 111-1111
    Frodo Baggins 222-2222

    I have a form that users use to get the results, and I'm trying to
    hide some employees (rows) from being displayed (I have some employees
    who don't want to be shown). Does anyone have any idea how to go with
    this?
    Samson, Jun 3, 2004
    #1
    1. Advertising

  2. Samson

    Raterus Guest

    Well, either restrict the rows based on your sql statement, or taint your results by removing rows from the datasource before binding them to the datagrid. Or you could inherit from the Ring Class, and invoke the "OneRingToRuleThemAll" method, that seems to fix all my problems, perhaps yours?

    "Samson" <> wrote in message news:...
    > I have a datagrid bound to an employee database table, which looks
    > something like this:
    >
    > FirstName LastName PhoneNumber Email
    > ---------------------------------------------
    > John Baggins 111-1111
    > Frodo Baggins 222-2222
    >
    > I have a form that users use to get the results, and I'm trying to
    > hide some employees (rows) from being displayed (I have some employees
    > who don't want to be shown). Does anyone have any idea how to go with
    > this?
    Raterus, Jun 3, 2004
    #2
    1. Advertising

  3. There various ways to do this,

    1. You can do this at Database Layer, so that you will fetch only requried
    records. (Recommended)

    2. Doing filter at DataSource. For example if you datasource is dataset,
    then you can filter dataset using Select or Find method. (If not 1 then 2)

    3. When you bind the datagrid, during itemdatabound event. You can check for
    condition and delete that item (not recommended)

    --
    Saravana
    Microsoft MVP - ASP.NET
    www.extremeexperts.com



    "Samson" <> wrote in message
    news:...
    > I have a datagrid bound to an employee database table, which looks
    > something like this:
    >
    > FirstName LastName PhoneNumber Email
    > ---------------------------------------------
    > John Baggins 111-1111
    > Frodo Baggins 222-2222
    >
    > I have a form that users use to get the results, and I'm trying to
    > hide some employees (rows) from being displayed (I have some employees
    > who don't want to be shown). Does anyone have any idea how to go with
    > this?
    Saravana [MVP], Jun 4, 2004
    #3
    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. moondaddy

    Remove row from datagrid dynamicly

    moondaddy, Jun 26, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    12,306
    moondaddy
    Jun 30, 2004
  2. Henke
    Replies:
    2
    Views:
    352
    Eliyahu Goldin
    Sep 8, 2004
  3. =?Utf-8?B?TWFubnkgQ2hvaGFu?=

    Hide image in datagrid row

    =?Utf-8?B?TWFubnkgQ2hvaGFu?=, Aug 25, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    682
    Eliyahu Goldin
    Aug 25, 2005
  4. D
    Replies:
    0
    Views:
    197
  5. UJ
    Replies:
    1
    Views:
    123
Loading...

Share This Page