justin_smith
asked on
GridView Sorting
Hi,
I am using SqlDataSource to bind data to Gridview....
i am forced to determined the query only dynamically..
so it is all done programatically...
I am having in issue with implementing a handler for sorting..
Can someone help me with a handler that works with SqlDataSource as the DataSource for GridView....
Also how can we get a DataTable from SqlDataSource
I am using SqlDataSource to bind data to Gridview....
i am forced to determined the query only dynamically..
so it is all done programatically...
I am having in issue with implementing a handler for sorting..
Can someone help me with a handler that works with SqlDataSource as the DataSource for GridView....
Also how can we get a DataTable from SqlDataSource
ASKER
I will have to implement this way if nothing works..(cos i have to rewrite what i have do so far)
but...
I am with you in use of DataView.
please let me know if this can be done..
1)Can i get DataView / DataTable object from GridView.DataSource
2)I am pretty sure this could be easily done if i initially used DataTable instead of SqlDataSource object
but...
I am with you in use of DataView.
please let me know if this can be done..
1)Can i get DataView / DataTable object from GridView.DataSource
2)I am pretty sure this could be easily done if i initially used DataTable instead of SqlDataSource object
i think you can...
use it this way....
use it this way....
DataTable dt = (DataTable)YourGridViewName.DataSource;
ASKER
this is what i get
Unable to cast object of type 'System.Web.UI.WebControls .SqlDataSo urce' to type 'System.Data.DataTable'.
Unable to cast object of type 'System.Web.UI.WebControls
Since you are assigning a SqlDataSource you probably might not be able to cast it directly...here is a link that might be helpful
http://www.developersdex.com/asp/message.asp?p=1116&r=6178158
if you can share your code i will look at it...
http://www.developersdex.com/asp/message.asp?p=1116&r=6178158
if you can share your code i will look at it...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i am also using dynamic loading of a gridview wherein my query changes for each screen and my internal datagrid loading dynamically...i managed to achieve the loading time (15 records per view) in less than a second for tables with more than a 100 thousand records....
Open in new window