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

On Edit Click, Grid Disappears

1 Answer 149 Views
Grid
This is a migrated thread and some comments may be shown as answers.
SchaF
Top achievements
Rank 1
SchaF asked on 24 Jun 2013, 03:12 PM
When I click the edit button of my grid, the grid disappears. I have read about advanced data binding using the NeedDataSource event, but I do not think this is applicable in my case.

I have it going to the database to get 2 other objects first, (using if/else blocks to go down further when there are no returned errors), and in the last if block, its using those 2 objects to go to the database to retrieve my final data set. I have to do it this way because the dataset will be dynamic based on values from the first 2 objects. When I get this back, I want to use some of the variables from the first 2 objects (if a field is editable, max field length etc), to update the columns in the gridview to readonly or their length etc. Then after the user edits the fields, it will make the changes to the DataSet (which is the grids DataSource) and when they are done making all changes (not just to one row), I want to send the entire DataSet to the database to a stored proc that will perform the updates as needed.

Is there anyway to make this happen? Can anyone point me in the right direction? 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 27 Jun 2013, 08:16 AM
Hello Brandon,

Please note that using DataBind() in this case is not recommended. Performing complex grid operations such as Inserting, Deleting, Updating, Hierarchy relations, Grouping, Paging, Sorting, Filtering, etc. require accommodating appropriate database operations.  Therefore, we suggest you to avoid Simple Databinding and strongly recommend the use of more advanced databinding methods, which automatically handle the aforementioned functions:
Declarative DataSource
Advanced Data Binding

You will still be able to configure your datasource dynamically. Just use a global or State condition variable to return different sources on the fly inside the NeedDataSource event. 

Hope this helps.

In addition, you can check out the following demo in case you want to use Batch updating:
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/batchediting/defaultcs.aspx

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
SchaF
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or