|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ASP.NET - Deleting rows from an unbound gridviewI 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. 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. -- Show quoteRegards, Robson Siqueira Enterprise Architect "Greg" <spammesilly1@yahoo.co.uk> wrote in message news:1170357395.628881.184650@v45g2000cwv.googlegroups.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. > By the way, next time instead of post the same subject on different
newsgroups, try to copy them, if necessary. -- Show quoteRegards, Robson Siqueira Enterprise Architect "Greg" <spammesilly1@yahoo.co.uk> wrote in message news:1170357395.628881.184650@v45g2000cwv.googlegroups.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. > 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. ----------------------------------------------------- Show quote "Robson Siqueira" <rob***@robsonfelix.com> wrote in message news:%237xhvzkRHHA.3316@TK2MSFTNGP02.phx.gbl... > By the way, next time instead of post the same subject on different > newsgroups, try to copy them, if necessary. > > -- > Regards, > Robson Siqueira > Enterprise Architect > "Greg" <spammesilly1@yahoo.co.uk> wrote in message > news:1170357395.628881.184650@v45g2000cwv.googlegroups.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. >> > > |
|||||||||||||||||||||||