Click here to Skip to main content
15,927,347 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: ASP.Net 2.0 book Pin
ademsandeepreddy17-Sep-07 18:32
ademsandeepreddy17-Sep-07 18:32 
Questionhow to redirect to the next page Pin
bhattiprolu17-Sep-07 3:12
bhattiprolu17-Sep-07 3:12 
AnswerRe: how to redirect to the next page Pin
Sandeep Akhare17-Sep-07 4:31
Sandeep Akhare17-Sep-07 4:31 
Questionmultiple authentication levels in a web application Pin
pete007_ke17-Sep-07 2:44
pete007_ke17-Sep-07 2:44 
AnswerRe: multiple authentication levels in a web application Pin
SHatchard17-Sep-07 3:09
SHatchard17-Sep-07 3:09 
QuestionGridView sorting Pin
Ballita17-Sep-07 2:16
Ballita17-Sep-07 2:16 
AnswerRe: GridView sorting Pin
Imran Khan Pathan17-Sep-07 2:18
Imran Khan Pathan17-Sep-07 2:18 
AnswerRe: GridView sorting Pin
VenkataRamana.Gali17-Sep-07 2:25
VenkataRamana.Gali17-Sep-07 2:25 
private DataSet GetData()<br />
{<br />
  SqlConnection myConnection = new SqlConnection(ConnectionString);<br />
  SqlDataAdapter ad = new SqlDataAdapter("SELECT * FROM Categories", myConnection);<br />
<br />
 DataSet ds = new DataSet();<br />
 ad.Fill(ds);<br />
 return ds; <br />
}<br />

<asp:GridView ID="GridView1" runat="server" AllowSorting="True" OnSorting="GridView1_Sorting"><br />
</asp:GridView><br />

<br />
public SortDirection GridViewSortDirection<br />
{<br />
 get<br />
 {<br />
  if (ViewState["sortDirection"] == null)<br />
  ViewState["sortDirection"] = SortDirection.Ascending;<br />
  return (SortDirection) ViewState["sortDirection"]; <br />
 }<br />
<br />
 set { ViewState["sortDirection"] = value; } <br />
}<br />

<br />
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)<br />
{<br />
string sortExpression = e.SortExpression;<br />
if (GridViewSortDirection == SortDirection.Ascending)<br />
{<br />
 GridViewSortDirection = SortDirection.Descending;<br />
 SortGridView(sortExpression, DESCENDING);<br />
}<br />
else<br />
{<br />
 GridViewSortDirection = SortDirection.Ascending;<br />
 SortGridView(sortExpression, ASCENDING); <br />
} <br />
}<br />

<br />
private void SortGridView(string sortExpression,string direction)<br />
{<br />
 // You can cache the DataTable for improving performance<br />
 DataTable dt = GetData().Tables[0]; <br />
 DataView dv = new DataView(dt); <br />
 dv.Sort = sortExpression + direction; <br />
 GridView1.DataSource = dv;<br />
 GridView1.DataBind(); <br />
}<br />


Ramana

AnswerRe: GridView sorting Pin
Kasi Viswanathan17-Sep-07 2:32
Kasi Viswanathan17-Sep-07 2:32 
QuestionUpload image? Pin
Kasi Viswanathan17-Sep-07 1:20
Kasi Viswanathan17-Sep-07 1:20 
AnswerRe: Upload image? Pin
monu nair17-Sep-07 1:36
monu nair17-Sep-07 1:36 
GeneralRe: Upload image? Pin
Kasi Viswanathan17-Sep-07 2:17
Kasi Viswanathan17-Sep-07 2:17 
AnswerRe: Upload image? Pin
VenkataRamana.Gali17-Sep-07 1:37
VenkataRamana.Gali17-Sep-07 1:37 
GeneralRe: Upload image? Pin
Kasi Viswanathan17-Sep-07 2:22
Kasi Viswanathan17-Sep-07 2:22 
GeneralRe: Upload image? Pin
VenkataRamana.Gali17-Sep-07 2:26
VenkataRamana.Gali17-Sep-07 2:26 
Questionpagination Pin
foysal mamun17-Sep-07 1:18
foysal mamun17-Sep-07 1:18 
Questiondatabase is accessed by the vb6.0 application and the website Pin
Sonia Gupta17-Sep-07 1:13
Sonia Gupta17-Sep-07 1:13 
AnswerRe: database is accessed by the vb6.0 application and the website Pin
VenkataRamana.Gali17-Sep-07 2:55
VenkataRamana.Gali17-Sep-07 2:55 
Questionhow to check different browser in javascript Pin
Piyush Vardhan Singh17-Sep-07 1:10
Piyush Vardhan Singh17-Sep-07 1:10 
AnswerRe: how to check different browser in javascript Pin
Imran Khan Pathan17-Sep-07 1:34
Imran Khan Pathan17-Sep-07 1:34 
QuestionMembership create user exeption Pin
kimo code17-Sep-07 0:53
kimo code17-Sep-07 0:53 
AnswerRe: Membership create user exeption Pin
VenkataRamana.Gali17-Sep-07 1:32
VenkataRamana.Gali17-Sep-07 1:32 
GeneralRe: Membership create user exeption Pin
kimo code17-Sep-07 1:35
kimo code17-Sep-07 1:35 
GeneralRe: Membership create user exeption Pin
kimo code17-Sep-07 1:51
kimo code17-Sep-07 1:51 
GeneralRe: Membership create user exeption Pin
VenkataRamana.Gali17-Sep-07 2:18
VenkataRamana.Gali17-Sep-07 2:18 

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.