Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / February 2007

Tip: Looking for answers? Try searching our database.

ASP.NET - Deleting rows from an unbound gridview

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg - 01 Feb 2007 19:16 GMT
I have a gridview on my form which I have populated using a
datareader. What I would like to do is to be able to remove specified
records from the gridview, without affecting the source of the data.

I'm a bit confused about how to go about removing the rows - all the
google searches I have done so far seem to assume that the grid view
is bound and the programmer wants to delete the data from the original
source. Is there any easy way to do this - i.e. delete row x from the
grid?

I'd be grateful for any help with this!

Greg.
Robson Siqueira - 01 Feb 2007 22:03 GMT
Greg,

There is just one way to do it, IMHO. Probably you have a primary key,
right? The options I can give you are:

a) create a new column on your main table - the one with the primary key -
changing it to show or hide the record
b) add the primary key value of each deleted record to a list. When reading
the values from the database, check to see if the PK is not on your internal
list.

I hope it helps.

Signature

Regards,
Robson Siqueira
Enterprise Architect

>I have a gridview on my form which I have populated using a
> datareader. What I would like to do is to be able to remove specified
[quoted text clipped - 9 lines]
>
> Greg.
Robson Siqueira - 01 Feb 2007 22:04 GMT
By the way, next time instead of post the same subject on different
newsgroups, try to copy them, if necessary.

Signature

Regards,
Robson Siqueira
Enterprise Architect

>I have a gridview on my form which I have populated using a
> datareader. What I would like to do is to be able to remove specified
[quoted text clipped - 9 lines]
>
> Greg.
RobinS - 01 Feb 2007 22:47 GMT
Or better yet, cross-post them, i.e. post it in all the newsgroups at one
time. That way if someone in one group has an answer, the people in the
other groups can see it.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------------
> By the way, next time instead of post the same subject on different
> newsgroups, try to copy them, if necessary.
[quoted text clipped - 12 lines]
>>
>> Greg.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.