Click here to Skip to main content
15,887,417 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: LINQ Disadvantages Pin
S.Dhanasekaran23-Sep-09 2:32
S.Dhanasekaran23-Sep-09 2:32 
GeneralRe: LINQ Disadvantages Pin
Not Active23-Sep-09 2:27
mentorNot Active23-Sep-09 2:27 
GeneralRe: LINQ Disadvantages Pin
Vimalsoft(Pty) Ltd23-Sep-09 2:41
professionalVimalsoft(Pty) Ltd23-Sep-09 2:41 
QuestionPrinting at specfic point at page Pin
Thekaninos22-Sep-09 22:53
Thekaninos22-Sep-09 22:53 
AnswerRe: Printing at specfic point at page Pin
N a v a n e e t h22-Sep-09 23:57
N a v a n e e t h22-Sep-09 23:57 
QuestionResource file in .net Pin
monika_vasvani22-Sep-09 22:44
monika_vasvani22-Sep-09 22:44 
AnswerRe: Resource file in .net Pin
S.Dhanasekaran22-Sep-09 23:33
S.Dhanasekaran22-Sep-09 23:33 
Questiongridview date sorting in asp.net????????????????? Pin
srinivassam22-Sep-09 21:33
srinivassam22-Sep-09 21:33 
Hi all,

I have one doubt, i am fetching data from database and i am displaying data in gridview.(select empid,empno,covert(varchar,dateofbith,101),convert(varchar,joiningdate,101) from emptable) (values are:1,12,'12/31/1986','12/31/2008')

i am not using any boundfields in gridview.

i am using this code to sort the gridview columns,everything is working fine but dateofbirth,joiningdate fields sorting is not working .

i am using below code to sort the gridview columns:
If Not (Page.IsPostBack) Then
ViewState("Sort") = "asc"
end if

and

Protected Sub grdCommon_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles grdCommon.Sorting
Try


grdCommon.DataSource = Session("grdCommon")
grdCommon.DataBind()

Dim dataTable As DataTable = CType(grdCommon.DataSource, DataTable) ' DirectCast(ViewState("grdCommon.DataSource"), DataTable)
Dim dataView As DataView = New DataView(dataTable)

If Not (dataView Is Nothing) Then
If ViewState("Sort").ToString() = " asc" Then
ViewState("Sort") = " desc"
Else
ViewState("Sort") = " asc"
End If
dataView.Sort = e.SortExpression + ViewState("Sort").ToString()
grdCommon.DataSource = dataView
ViewState("grdCommon.DataSource") = dataView.Table
grdCommon.DataBind()
End If
end sub


Regards
Rama

samrama

AnswerRe: gridview date sorting in asp.net????????????????? Pin
S.Dhanasekaran22-Sep-09 23:59
S.Dhanasekaran22-Sep-09 23:59 
QuestionSave data from a html table to database Pin
yesu prakash22-Sep-09 21:15
yesu prakash22-Sep-09 21:15 
AnswerRe: Save data from a html table to database Pin
Abhishek Sur23-Sep-09 0:03
professionalAbhishek Sur23-Sep-09 0:03 
QuestionDATASET refresh every second - problem Pin
j_u_sankar22-Sep-09 20:43
j_u_sankar22-Sep-09 20:43 
AnswerRe: DATASET refresh every second - problem Pin
Vimalsoft(Pty) Ltd23-Sep-09 0:29
professionalVimalsoft(Pty) Ltd23-Sep-09 0:29 
QuestionCrystal Sub-report displaying the redundant records... Pin
jmk_cooljack22-Sep-09 20:42
jmk_cooljack22-Sep-09 20:42 
Questionemail Pin
mylogics22-Sep-09 20:27
professionalmylogics22-Sep-09 20:27 
AnswerRe: email Pin
Ravi Mori22-Sep-09 20:35
Ravi Mori22-Sep-09 20:35 
AnswerRe: email Pin
Abhijit Jana22-Sep-09 21:11
professionalAbhijit Jana22-Sep-09 21:11 
AnswerRe: email Pin
Vimalsoft(Pty) Ltd23-Sep-09 0:34
professionalVimalsoft(Pty) Ltd23-Sep-09 0:34 
QuestionASP.NET Membership Pin
Illegal Operation22-Sep-09 18:56
Illegal Operation22-Sep-09 18:56 
AnswerRe: ASP.NET Membership Pin
Nisha Agrawal23-Sep-09 3:10
Nisha Agrawal23-Sep-09 3:10 
QuestionContent-Disposition attachment not working in IE 7 Pin
sudhirBirlapur22-Sep-09 18:45
sudhirBirlapur22-Sep-09 18:45 
AnswerRe: Content-Disposition attachment not working in IE 7 Pin
S.Dhanasekaran23-Sep-09 0:51
S.Dhanasekaran23-Sep-09 0:51 
QuestionNeed help with dynamic load of several control instances Pin
Michael Eber22-Sep-09 14:19
Michael Eber22-Sep-09 14:19 
AnswerRe: Need help with dynamic load of several control instances Pin
N a v a n e e t h22-Sep-09 15:54
N a v a n e e t h22-Sep-09 15:54 
GeneralRe: Need help with dynamic load of several control instances [modified] Pin
Michael Eber25-Sep-09 13:42
Michael Eber25-Sep-09 13:42 

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.