This is a migrated thread and some comments may be shown as answers.

Binding RadGrid with DataTable

1 Answer 196 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amit
Top achievements
Rank 1
Amit asked on 15 Oct 2010, 05:38 AM
Hey everyone,

I want to create a radgrid which inserts records from insert command Add new records(Automatic insert),but i want this using datatable as dataSource.And once i have added records then i want my grid to be empty on a button click outside grid,and records get saved to database table.So,grid is again empty for inserting new records.When in insert mode,i have gridDropDownColumn,and 3 template columns with 2 labels and a numericTextBox.Is there any demo or example describing this scenario?...

Thanks
Amit

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 15 Oct 2010, 07:08 AM
Hi Amit,


The automatic data source operations only work when binding the grid to a declarative data source using the DataSourceID property of the grid. You must configure the data source so that it supports the automatic operations.

That means, you need to write the code for updating db according to datatable value. See the following links for more information.
Update/Insert/Delete through queries at database level
Manual Insert/Update/Delete operations using Auto-generated editform with sql statements from the code-behind


And in order to show the empty grid, set the DataSource of grid as empty datatable.


-Shinu.
Tags
Grid
Asked by
Amit
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or