473,405 Members | 2,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

TemplateColumn & Sorting ( Does not fire the event)

Hi. I have a TemplateColumn with sorting. However, it does not fire the
sort event. Here is what I have. Please help.

<asp:TemplateColumn HeaderText="Wire ID"
SortExpression="WireID">
<itemtemplate>
<a href='<%# "Wire.aspx" + "?PackageID=" +
Request.QueryString["PackageID"] + "&WireID=" +
DataBinder.Eval(Container.DataItem, "WireID") + "&AgentID=" +
DataBinder.Eval(Container.DataItem, "AgentID") + "&CustomerType=" +
DataBinder.Eval(Container.DataItem, "CustomerType") %>'>
<%# DataBinder.Eval(Container.DataItem, "WireID") %>
</a>
</itemtemplate>
</asp:TemplateColumn>

++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++

In the code behind,

private void InitializeComponent()
{
//this.lnkWireID = new LinkButton();
//this.lnkWireID.ID = "lnkWireID";

this.btnInclude.Click += new System.EventHandler(this.btnInclude_Click);
this.btnApprove.Click += new System.EventHandler(this.btnApprove_Click);
this.CustomerType.SelectedIndexChanged += new
System.EventHandler(this.CustomerType_SelectedInde xChanged);
this.DataGrid1.SortCommand += new
System.Web.UI.WebControls.DataGridSortCommandEvent Handler(this.SortData);
this.Load += new System.EventHandler(this.Page_Load);

}

++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++

private void SortData(Object sender, DataGridSortCommandEventArgs e)
{
Session["SortColumn"] = (string) e.SortExpression;
string sSortOrder = (string) Session["SortOrder"];

if (sSortOrder == " desc")
Session["SortOrder"] = " asc";
else
Session["SortOrder"] = " desc";

BindData();
}

Thanks
Jack

--
Be Cool!
Nov 22 '05 #1
0 997

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: thejackofall | last post by:
Hi. I have a TemplateColumn with sorting. However, it does not fire the sort event. Here is what I have. Please help. <asp:TemplateColumn HeaderText="Wire ID" SortExpression="WireID">...
4
by: Varghjärta | last post by:
Hey! I'm a hobby programmer since many years now and I've done most of my latest 'real application' coding in C#. I've played with python of and on yet not catching on until a few months ago...
1
by: Sargas Atum | last post by:
Hi all, 1. I have a problem with cell selection in a table in a DataGrid. I dont want that anybody writes in the cells. That was not a problem I changed them to "read only", but if I am going...
0
by: Dave | last post by:
Hi, I have an ATL com object that fire event to its container the event method pass a BYTE* (pointer to bytes) variable as argument that points to block of memory, how can I catch this event in...
2
by: Curtis Kam | last post by:
Dear all, I'm now using TCP socket using user-defined protocol to communicate between two machines (server and client). But now, I'd like to introduce a Web Service in my server-side. If my...
6
by: sjoshi | last post by:
I have a derived class OraBackup which has a method that calls stored procedure on Oracledb to get status of backup job. Now the base class publishes an event like this: public delegate void...
0
by: pargat.singh | last post by:
Hi Everyone: I have a gridview control with AllowSorting="True" and work ok. But my page will be used by different user from different region so i need to change the HeaderText based on language...
2
by: reflex | last post by:
Hi, i am making plugin for wysiwyg editor. I need fire event inside *.htc file, when hyperlink is inserted throught editor (only IE method execCommand). Thx for help reflex
2
by: Naskar | last post by:
How to fire event of a TActiveForm ? // -------------- FormTeste01Impl1.cpp #include "FormTeste01Impl1.h" .... Others Events ... // Method of TEvents_.....Impl void __fastcall...
1
by: =?Utf-8?B?cGVsZWdrMQ==?= | last post by:
how can i fire event on doubleclick and what function/and how do i read the selected list of values? thnaks in advance peleg
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.