By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,783 Members | 1,347 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,783 IT Pros & Developers. It's quick & easy.

ASP.NET Deleting rows from an unbound gridview

P: n/a
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.

Feb 1 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.

--
Regards,
Robson Siqueira
Enterprise Architect
"Greg" <sp**********@yahoo.co.ukwrote in message
news:11**********************@v45g2000cwv.googlegr oups.com...
>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.

Feb 1 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.