One DataTable two DataGrids???
-
Can I use one DataTable and bind it to two DataGrids, each on a separate page? If not, what other options have I got? Ironsmith
-
Can I use one DataTable and bind it to two DataGrids, each on a separate page? If not, what other options have I got? Ironsmith
You can store the data table in session or viewstate, but neither of them are particularly good options if performance is important or you are running on a server farm. If it is static data then you can store the DataTable in the cache or cache the data grid output.
I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
-
You can store the data table in session or viewstate, but neither of them are particularly good options if performance is important or you are running on a server farm. If it is static data then you can store the DataTable in the cache or cache the data grid output.
I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
Hello, Yes I have the DataTable stored in session state, and no, performance isn't an issue on this one. I can bind the DataTable to one DataGrid no problem, but when I tried to bind it to the other one on a different form, it wouldn't work. I didn't recieve an error, there was just no DataGrid on the form. I did reuse the same code to bind this DataGrid as I did the first DataGrid though. Take care Ironsmith
-
Hello, Yes I have the DataTable stored in session state, and no, performance isn't an issue on this one. I can bind the DataTable to one DataGrid no problem, but when I tried to bind it to the other one on a different form, it wouldn't work. I didn't recieve an error, there was just no DataGrid on the form. I did reuse the same code to bind this DataGrid as I did the first DataGrid though. Take care Ironsmith
Hi again, :laugh: How do you go from the first page where you save the data table in Session to another page consuming this datatable? If you simply open a new browser then go to the second page then a new Session will be initialized, and of course there is no table in there, you therefore will not see any grid on the form though you reuse the same code.
-
Hi again, :laugh: How do you go from the first page where you save the data table in Session to another page consuming this datatable? If you simply open a new browser then go to the second page then a new Session will be initialized, and of course there is no table in there, you therefore will not see any grid on the form though you reuse the same code.
Hello, No I'm still in the same app. I got a shopping cart page, then a order details page, so all I do is hit a button to get to the next page. So anything in session state should still carry over to the next page right? Its like a cookie with user info, I can transfer that info to any other page in the app. So it should be the same with a DataTable in session state. Therefore, I used the same code to populate this new table as I did the other one. Take care Ironsmith
-
Hello, No I'm still in the same app. I got a shopping cart page, then a order details page, so all I do is hit a button to get to the next page. So anything in session state should still carry over to the next page right? Its like a cookie with user info, I can transfer that info to any other page in the app. So it should be the same with a DataTable in session state. Therefore, I used the same code to populate this new table as I did the other one. Take care Ironsmith
Yes, you're right, the session state variables should be there. Have you tried to run the app in debug mode and see whether the data table is still in Session? The reasons can be that the datasource is null, or the columns are not specified, then at run time you see nothing at the client side.
-
Yes, you're right, the session state variables should be there. Have you tried to run the app in debug mode and see whether the data table is still in Session? The reasons can be that the datasource is null, or the columns are not specified, then at run time you see nothing at the client side.
Yes this one works now, strange thing too. It wasn't appearing on the form at run time, but the DataTable was there in session state. So I dropped the DataGrid and dragged a new one onto the form, and now it works fine. lol. Take care Ironsmith
-
Yes this one works now, strange thing too. It wasn't appearing on the form at run time, but the DataTable was there in session state. So I dropped the DataGrid and dragged a new one onto the form, and now it works fine. lol. Take care Ironsmith