Click here to Skip to main content
15,897,518 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Nested Query Results (DataReader woes) Pin
GregStevens24-Mar-07 14:22
GregStevens24-Mar-07 14:22 
GeneralRe: Nested Query Results (DataReader woes) Pin
kubben24-Mar-07 14:36
kubben24-Mar-07 14:36 
GeneralRe: Nested Query Results (DataReader woes) Pin
GregStevens24-Mar-07 15:40
GregStevens24-Mar-07 15:40 
AnswerRe: Nested Query Results (DataReader woes) Pin
Jesse Squire25-Mar-07 1:35
Jesse Squire25-Mar-07 1:35 
QuestionArrayList Resetting When Adding Form Controls Pin
redfish3424-Mar-07 9:01
redfish3424-Mar-07 9:01 
Questiondatagrid sorting Pin
vsk84200524-Mar-07 8:24
vsk84200524-Mar-07 8:24 
AnswerRe: datagrid sorting Pin
kubben24-Mar-07 13:59
kubben24-Mar-07 13:59 
AnswerRe: datagrid sorting Pin
Rahithi24-Mar-07 19:52
Rahithi24-Mar-07 19:52 
Hi,

we can sort the data grid on column. i saw this few days back in one article.

you have tp set the AllowSorting property of the DataGrid to True. This property changes all of the column header text to hyperlinks. A click on the header text hyperlink causes a post-back and a call to the OnSortCommand event handler.
In datagrid control creation u have to set these properties:

AllowSorting as "True" and OnsortCommand as "SortCommand_OnClick"

In the OnSortCommand event handler you simply need to specify how the data should be sorted, recreate the data source and bind the data to the DataGrid. Currently creating the data source and the data binding are done in the BindData() method, so really all you need to do is specify how the data should be sorted before calling the BindData() method. In other words, redefine the SQL statement. Since the SQL statement is a page-level variable you have access to it in the OnSortCommand event handler.

u can write the OnSortCommand event handler.
\\ Sub SortCommand_OnClick(Source As Object, E As DataGridSortCommandEventArgs)
_sqlStmt = _sqlStmt & " ORDER BY " & E.SortExpression
BindData()
End Sub \\


hope this will give you some idea.

Thanks,
Rahithi Sharma










If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "

GeneralRe: datagrid sorting Pin
siddisagar25-Mar-07 18:40
siddisagar25-Mar-07 18:40 
QuestionDeployment of asp pages on IIS Pin
MinhajuddinK24-Mar-07 7:34
MinhajuddinK24-Mar-07 7:34 
AnswerRe: Deployment of asp pages on IIS Pin
Christian Graus24-Mar-07 7:40
protectorChristian Graus24-Mar-07 7:40 
QuestionRe: Deployment of asp pages on IIS [modified] Pin
MinhajuddinK24-Mar-07 7:46
MinhajuddinK24-Mar-07 7:46 
GeneralRe: Deployment of asp pages on IIS Pin
MinhajuddinK24-Mar-07 8:09
MinhajuddinK24-Mar-07 8:09 
AnswerRe: Deployment of asp pages on IIS Pin
GregStevens25-Mar-07 16:42
GregStevens25-Mar-07 16:42 
QuestionRe: Deployment of asp pages on IIS Pin
MinhajuddinK25-Mar-07 17:05
MinhajuddinK25-Mar-07 17:05 
QuestionPassing windows authentication between different sites [modified] Pin
vaibhav_vartak24-Mar-07 5:43
vaibhav_vartak24-Mar-07 5:43 
QuestionResponse.Redirect Question??? Pin
Tkml23624-Mar-07 2:53
Tkml23624-Mar-07 2:53 
QuestionAdding a record to a datagrid Pin
gauthee24-Mar-07 2:32
gauthee24-Mar-07 2:32 
AnswerRe: Adding a record to a datagrid Pin
kubben24-Mar-07 2:35
kubben24-Mar-07 2:35 
GeneralRe: Adding a record to a datagrid Pin
gauthee24-Mar-07 2:40
gauthee24-Mar-07 2:40 
GeneralRe: Adding a record to a datagrid Pin
kubben24-Mar-07 2:43
kubben24-Mar-07 2:43 
GeneralRe: Adding a record to a datagrid Pin
GregStevens24-Mar-07 14:17
GregStevens24-Mar-07 14:17 
AnswerRe: Adding a record to a datagrid Pin
siddisagar25-Mar-07 18:44
siddisagar25-Mar-07 18:44 
QuestionServer side and client side Pin
Tkml23624-Mar-07 2:26
Tkml23624-Mar-07 2:26 
QuestionVersioning. Pin
Sam.M24-Mar-07 1:52
Sam.M24-Mar-07 1:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.