Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:644222
More Search Options
RSS Available
Matching Posts
Re: HOW TO: Using sorting / paging on GridView w/o a DataSourceControl DataSource
I added the following code: lblSearchResults.Text = gvResults.DataSource.GetType().ToString(); DataTable table = gvResults.DataSource as DataTable ; if (table == null ) { lblSearchResults.Text = lblSearchResults.Text + " TABLE STILL CAME BACK NULL" ; } It blew up when attempting to GetType saying "Object reference not set to an instance of an object.". No matter though, I saved the table to cache after initially populating the grid which works well. When I call the sort I look for the cached table
Posted to
FAQ - Frequently Asked Questions
(Forum)
by
robbyram
on 2/15/2006
Re: HOW TO: Using sorting / paging on GridView w/o a DataSourceControl DataSource
Can you please explain a little further. I used a DataTable to bind to my grid. gvResults.DataSource = ds.Tables[0]; gvResults.DataBind(); That worked fine, however the only way I was able to make the sort work using your example I had to hold onto the datasource via ViewState ViewState["gvResults_DataSource"] = gvResults.DataSource; After having done that I was able to modify the first line of the sorting routine to DataTable dt = (DataTable)ViewState["gvResults_DataSource"]; The sort worked after
Posted to
FAQ - Frequently Asked Questions
(Forum)
by
robbyram
on 2/14/2006
Page 1 of 1 (2 items)
WindowsClient:
Debugging Crash Dumps with Visual Studio 2010
WindowsClient:
Debugging Crash Dumps with Visual Studio 2010
Channel 9:
Channel 9 Live at PDC09 Kurt DelBene
Channel 9:
Channel 9 Live at PDC09 Mike Anguilo
Channel 9:
Channel 9 Live at PDC09: Dean Hachamovitch
Channel 9:
Channel 9 Live at PDC09: Gary Flake
Channel 9:
Channel 9 Live at PDC09: Mark Russinovich and Patrick Dussud
Channel 9:
Ping 40: Black screen claims- retracted, Windows 7, Bing Maps, Office 2010
WindowsClient:
WPF Touch Basics
WindowsClient:
WPF Touch Basics
TechNet Edge:
AlignIT IT Manager Podcast #32: Agile Application Lifecycle Management
Channel 9:
Bharat Shah: Microsoft Online Services Overview
WindowsClient:
Holland America adds Surface to several ships in it’s new Mix lounge
ASP.NET:
RIA Services Link Listing #1
Channel 9:
Reactive Extensions API in depth: Merge
TechNet Edge:
Forefront Protection for Exchange customer story
WindowsClient:
Windows Client Developer Roundup for 12/7/2009
WindowsClient:
Introducing the new Bing Maps beta
ASP.NET:
My Presentations in Europe (December 2009)
Channel 9:
Channel 9 Live at PDC09: Dr Jeff Norris, NASA
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online