Quote:
My question is that when we put a row from a gridview to datatable Is it removed from that Gridview?
GridView
is just a view of the Data, which you bind to it using any
DataSource
like
DataSet
or
DataTable
.
If, you want to remove any row from
GridView
, then you need to delete that row from the
DataSource
that is the
DataSet
or
DataTable
or directly from database table.
And after every operation, you need to bind the
GridView
again using the same
DataSource
, so that it will contain the updated records, which will exclude that removed ones.
Refer -
ASP.NET - What is the difference of DataSourceID and DataSource?[
^].
Quote:
DataSource
refers to actual data source object which can be .NET provided data source controls (such as ObjectDataSource, SqlDataSource) or actual data objects such as DataTable, Collection of objects etc.
DataSourceID
is the string identifier for .NET provided data source control and this property exists so that data-bound control and corresponding data source can be associated at the design time in markup. Internally, the control would look up for actual data source control using the id provided.