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

Unique Datasource Switching Implementation

1 Answer 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 13 Feb 2014, 12:07 AM
Hi All,

I have an entirely code-behind, C#, RadGrid in a SharePoint web part.  

It needs to be able to switch between tables in a SQL database through the use of a drop-down list (containing the table names), and I have implemented this functionality by storing/retrieving the value of the drop-down list in a Page.Session variable.

The SqlDataSource and RadGrid are both built in CreateChildControls based upon the selected SQL Table from the drop-down list.  The RadGrid is manually built based upon the DataView/Table acquired through the SqlDataSource with GridBoundColumns, GridDateTimeColumns and Google-Like Filtering Columns based upon the datatype of the field/column.

When the drop-down list's value is changed that value is stored in a Page.Session variable and a response.redirect is called, refreshing the entire page, retrieving the selected SQL Table from the Page.Session variable and therefore building a new SqlDataSource and RadGrid with the new Table data.

This works well, but causes issues when multiple tabs/browser windows are open at the same time.  Since I use Page.Session to store the drop-down list value all of the tabs/browsers open will be of the same table on a per User basis, and they would like to ensure that each tab/window is unique.

Is there a better way of implementing this?

Thanks,
Mark




1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 17 Feb 2014, 12:46 PM
Hello Mark,

You can try integrating the solution suggested in this StackOverflow thread. It should help you store unique values for each tab.

Regards,
Angel Petrov
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 UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or