Click here to Skip to main content
15,926,035 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: how to update a row in data grid ?? Pin
rocky8116-Nov-07 5:20
rocky8116-Nov-07 5:20 
GeneralRe: how to update a row in data grid ?? Pin
John-ph6-Nov-07 5:25
John-ph6-Nov-07 5:25 
GeneralRe: how to update a row in data grid ?? Pin
rocky8116-Nov-07 5:30
rocky8116-Nov-07 5:30 
GeneralRe: how to update a row in data grid ?? Pin
John-ph6-Nov-07 19:21
John-ph6-Nov-07 19:21 
QuestionFormView Problem ASP.NET 2005 Pin
Haridas.R6-Nov-07 4:20
Haridas.R6-Nov-07 4:20 
AnswerRe: FormView Problem ASP.NET 2005 Pin
Rocky#6-Nov-07 4:42
Rocky#6-Nov-07 4:42 
QuestionAjax control toolkit tabcontainer - not rendered Pin
digsy_6-Nov-07 3:40
digsy_6-Nov-07 3:40 
QuestionSorting in a GridView Without Databinding Pin
Rocky#6-Nov-07 3:23
Rocky#6-Nov-07 3:23 
Hello everyone,

well I'm working in a module where i'm using a gridview to display data without binding it to it. Now its working but the only problem is that it doesnt sort in alternating ASC/DESC order like normal. I noticed while debugging that I was always getting the SortDirection in the OnSorting event as Ascending.

Is there some other way so that I can make the sorting in the usual Alternating way of ASC and DESC.

Hope u got what I'm saying Blush | :O

<asp:GridView ID="GridView1" runat="server" PageSize="20" DataKeyNames="DirectoryID" AutoGenerateColumns="False" AllowPaging="True"
OnPageIndexChanging="GridView1_PageIndexChanging" OnRowUpdating="GridView1_RowUpdating"
OnRowDeleting="GridView1_RowDeleting" AllowSorting="true" OnSorting="GridView1_OnSorting"
OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowCommand="EditButton_OnRowCommand">
<Columns>
<asp:TemplateField SortExpression="DirectoryID" HeaderText="DirectoryID" Visible="false">
<ItemTemplate>
<asp:Label ID="Label_ID" Text='<%# Eval("DirectoryID") %>' Runat="Server"/>
</ItemTemplate>
</asp:TemplateField>
...

and in the On sorting event I'm doin this

protected void GridView1_OnSorting(object sender, GridViewSortEventArgs e)
{
DataView dv = (DataView)Session["dvVD"];
if (dv != null)
{
//Vendor_Directory vd = new Vendor_Directory();
dv.Sort = e.SortExpression + ((e.SortDirection == SortDirection.Descending) ? " DESC": " ASC");
GridView1.DataSource = dv;
GridView1.DataBind();

}
}

Thanks in advance

Rocky

You can't climb up a ladder with your hands in your pockets.
AnswerRe: Sorting in a GridView Without Databinding Pin
John-ph6-Nov-07 4:01
John-ph6-Nov-07 4:01 
GeneralRe: Sorting in a GridView Without Databinding Pin
Rocky#6-Nov-07 4:07
Rocky#6-Nov-07 4:07 
GeneralRe: Sorting in a GridView Without Databinding Pin
Rocky#6-Nov-07 4:40
Rocky#6-Nov-07 4:40 
GeneralRe: Sorting in a GridView Without Databinding Pin
John-ph6-Nov-07 4:58
John-ph6-Nov-07 4:58 
QuestionIs Possible to show a youtube video in to aspx page?? Pin
bijeshputhalath6-Nov-07 2:32
bijeshputhalath6-Nov-07 2:32 
AnswerRe: Is Possible to show a youtube video in to aspx page?? Pin
Michael Sync6-Nov-07 3:47
Michael Sync6-Nov-07 3:47 
GeneralRe: Is Possible to show a youtube video in to aspx page?? Pin
bijeshputhalath6-Nov-07 18:13
bijeshputhalath6-Nov-07 18:13 
GeneralRe: Is Possible to show a youtube video in to aspx page?? Pin
Michael Sync6-Nov-07 18:31
Michael Sync6-Nov-07 18:31 
GeneralRe: Is Possible to show a youtube video in to aspx page?? Pin
bijeshputhalath6-Nov-07 21:04
bijeshputhalath6-Nov-07 21:04 
Questionauto update with cache Pin
ranandbe6-Nov-07 1:55
ranandbe6-Nov-07 1:55 
AnswerRe: auto update with cache Pin
John-ph6-Nov-07 2:23
John-ph6-Nov-07 2:23 
QuestionOpen Popup window Pin
Imran Khan Pathan6-Nov-07 1:08
Imran Khan Pathan6-Nov-07 1:08 
AnswerRe: Open Popup window Pin
N a v a n e e t h6-Nov-07 2:01
N a v a n e e t h6-Nov-07 2:01 
Questionsetup and querystring Pin
M.V6-Nov-07 0:28
M.V6-Nov-07 0:28 
AnswerRe: setup and querystring Pin
John-ph6-Nov-07 0:40
John-ph6-Nov-07 0:40 
GeneralRe: setup and querystring [modified] Pin
M.V6-Nov-07 6:45
M.V6-Nov-07 6:45 
QuestionHow to refresh page only one time Pin
srajasekhar6-Nov-07 0:15
srajasekhar6-Nov-07 0:15 

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.