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

Looking for the right way to configure datasource...

1 Answer 28 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Dan asked on 20 Jul 2017, 05:33 PM

I'm trying to find the best way to configure my radgrid to accomplish this scenario.

Here is the scenario:

(This all occurs within my Default.aspx page)

1. A radtextbox control prompts the user to input the customer number.  The customer number is validated using data coming from a table adapter.


2. I want to pass the customer number entered above into another query (table adapter) and return a item details dataset using it.  This is the dataset

that I want my RadGrid connected to. 


I have been able to figure out how to accomplish everything above by using the RadGrid (onneeddatasource) event. 

Here is where my problem comes in:


3.  One of the columns in my item details dataset (column name PRINT) is a Boolean datatype.   I have set the PRINT column in my datatable associated with the table adapter to read-only = false.  I need to give the user ability to (check or un-check) that column in my RadGrid and have it update the datatable only.  I have no requirement to go back and update the SQL database with the updated datatable.   This data is going to be used to generate a sql report which is included in this project.  

In summary, I haven't been able to find a way to query and store results in a local datatable and allow the radgrid to update that local datatable.  I've looked at the batch editing capability, but I don't like the way it requires having to press the save button in between paging.  I'd like to code it so that the user can click the check box and it immediately saves the result to the data table.  

Is there anyone out there that can give me some advice or an example of how I can accomplish this problem?


1 Answer, 1 is accepted

Sort by
Marin Bratanov
Telerik team
answered on 25 Jul 2017, 01:32 PM


I have just answered your support ticket with this question, and I am pasting my answer here for anyone else looking at a similar scenario:

If you need to operate with a specific object in memory, I can suggest you do the following:

  • Retrieve this object and store it somewhere (Session, Cache, ViewState, a file, an SQL table that is not related to the main server/database, there are many options and the correct one depends on your data access layer and approaches).
  • Provide this object to the grid in its NeedDataSource event (you have already found this).
  • Perform the manual CRUD operations on your specific object with your own code. You can see examples of how to do that in the following demo:
    • Depending on the way you have this setup (especially if you use a template column with a custom checkbox), perhaps you could simply subscribe to its CheckedChanged event and perform the necessary operation there, then call the Rebind() method of the grid to update its data if that's necessary.
  • You can also find a similar example that stores the data table in the session in the following forum thread: I must note that a data table is quite a heavy object and serializing it in the session or viewstate may cost system resources.





Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Asked by
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question