If you have already retrieved the data table from the database, it is no
longer connected to the database and any changes you make will not be
reflected in the database.  The table has a collection of rows.  You can
simply remove the row from the table and rebind the table to the grid.  The
grid will no longer display the row in question.

DataRow RowToRemove = SomeFunctionToSelectTheRow();
TheDataTable.Rows.Remove(RowToRemove);
YourGrid.DataSource = TheDataTable;

or just using the row index....

TheDataTable.Rows.RemoveAt(RowIndexToRemove);
YourGrid.DataSource = TheDataTable;




On 09 Apr 2007 18:18:42 -0700, tomm <[EMAIL PROTECTED]> wrote:
>
>   Only way I can think of is to requery the database using some key from
> the
> item row to not return it and rebind. So you'd create another stored proc
> to
> handle this and reassign the datasource select method to the new one,
> assign
> the parameter value and bind.
>
> tom mallard
> .net web applications
> consumer product design
>
> _____
>
> From: [email protected] <AspNet2%40yahoogroups.com> 
> [mailto:[email protected]<AspNet2%40yahoogroups.com>]
> On Behalf Of
> Rick
> Sent: Monday, April 09, 2007 1:52 PM
> To: [email protected] <AspNet2%40yahoogroups.com>
> Subject: [AspNet2] Delete a DataGrid Row
>
> Hello Again, thank you everyone once again for your help. Just one
> more question for ya. How do you remove a row from a datagrid once you
> no longer need it and want it gone. I don't want to do anything with
> the database, just remove that one row from view once it has served its
> purpose. Is there a way to do this? thanks again in advance??
>
> [Non-text portions of this message have been removed]
>
>  
>



-- 
Dean Fiala
Very Practical Software, Inc
Now with Blogging...
http://www.vpsw.com/blogbaby
Microsoft MVP


[Non-text portions of this message have been removed]

Reply via email to