Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > hide or remove a row from datagrid

Reply
Thread Tools

hide or remove a row from datagrid

 
 
Samson
Guest
Posts: n/a
 
      06-03-2004
I have a datagrid bound to an employee database table, which looks
something like this:

FirstName LastName PhoneNumber Email
---------------------------------------------
John Baggins 111-1111 http://www.velocityreviews.com/forums/(E-Mail Removed)
Frodo Baggins 222-2222 (E-Mail Removed)

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?
 
Reply With Quote
 
 
 
 
Raterus
Guest
Posts: n/a
 
      06-03-2004
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" <(E-Mail Removed)> wrote in message news:(E-Mail Removed) m...
> I have a datagrid bound to an employee database table, which looks
> something like this:
>
> FirstName LastName PhoneNumber Email
> ---------------------------------------------
> John Baggins 111-1111 (E-Mail Removed)
> Frodo Baggins 222-2222 (E-Mail Removed)
>
> 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?

 
Reply With Quote
 
 
 
 
Saravana [MVP]
Guest
Posts: n/a
 
      06-04-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m...
> I have a datagrid bound to an employee database table, which looks
> something like this:
>
> FirstName LastName PhoneNumber Email
> ---------------------------------------------
> John Baggins 111-1111 (E-Mail Removed)
> Frodo Baggins 222-2222 (E-Mail Removed)
>
> 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?



 
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
Can you hide the contents of a row but leave the row there? UJ ASP .Net Datagrid Control 1 05-02-2006 06:48 PM
Hide image in datagrid row =?Utf-8?B?TWFubnkgQ2hvaGFu?= ASP .Net 2 08-25-2005 09:59 AM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM
How to add a new row to a datagrid with values of the selected row =?Utf-8?B?U3VyZXNo?= ASP .Net 1 11-22-2004 09:04 AM
Referencing Dataset row not Datagrid row Craig ASP .Net 2 11-02-2004 05:27 PM



Advertisments