Loading...

Home > Not Working > Sortexpression In Gridview Not Working

Sortexpression In Gridview Not Working

Contents

Solution 1 Accept Solution Reject Solution You could try something like below (this is a sample code): Changed this : Category A value To This : A Yes No Additional feedback? 1500 characters remaining Submit Skip this Thank you! MY CODE BEHIND: public class StoredProceduresTwo { public static DataTable GetCostData() { DataTable CallCost = new DataTable(); SqlConnection cn; Insults are not welcome. http://philgiebler.com/not-working/sortexpression-not-working-gridview.html

Let's work to help developers, not make them feel stupid. Can anyone please let me know if this sorting functionality issupposed to work or not for a TemplateField, and if so, what do I need to do to get this working? But I want to have both functionalities. Subscribe to our monthly newsletter for tech news and trends Membership How it Works Gigs Live Careers Plans and Pricing For Business Become an Expert Resource Center About Us Who We

Gridview Allowsorting

What does this joke between Dean Martin and Frank Sinatra mean? Removed the sorting code and logged out of everthing. No, I am not getting any error. Integrity with anti-confidentiality Why do solar planes have many small propellers instead of fewer large ones?

Higher up doesn't carry around their security badge and asks others to let them in. Solution 1 Accept Solution Reject Solution check this link http://stackoverflow.com/questions/7661086/sort-gridview-by-proper-column-which-is-templatefield[^] Permalink Posted 16-Jan-13 0:14am josh-jw16.4K Rate this: Please Sign up or sign in to vote. Join & Ask a Question Need Help in Real-Time? Gridview Sortdirection Always Ascending Reply tullygarvan None 0 Points 16 Posts Re: Gridview: AllowSorting/SortExpression not working with TemplateField Jun 23, 2011 09:10 AM|tullygarvan|LINK I have it working now.

if (!IsPostBack) { Session["myDataSet"] = FillDataSet(); } } then in your sort method you retrieve the DataSource like this: DataTable dt = ((DataSet)Session["myDataSet"]).Tables[0]; Also you can retrieve the DataSet from session Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI I have done some searching, and from what I have seen, this should also work for TemplateField. When answering a question please: Read the question carefully.

Join the Connect(); 2016 livestream November 16 to hear the latest on developer and cloud technologies from Scott Guthrie! Should I report it? Should I report it? Is it giving you any error?

Gridview Allowsorting Not Working

Was Adi Shankaracharya’s Parakaya Pravesha to learn Kamashastra Dharmic? https://www.sitepoint.com/community/t/allowsorting-not-working-in-gridview/6830 Sort gridView by proper column which is TemplateField[^] protected void grd_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Sort")) { FilterExpression Gridview Allowsorting The DataSourceMode is set to DataSet for the SQLDataSource. Gridview Sorting Not Working Do I need an Indie Studio Name?

in tenure track job applications? You should consider custom paging, which is quite easy with linq. Can it work? A cup product in Galois cohomology of Elliptic curve What power do I have as a driver if my interstate route is blocked by a protest? Gridview Sortexpression

In databound field it is easy but by template field i just not able to do. Do you need your password? Viewstate will do the favour of that , try this public partial class CS_SortableGridview : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Check This Out AddSortImage(sortColumnIndex, e.Row); } } } // This is a helper method used to determine the index of the // column being sorted.

Gridview sorting with custom template fields[^]. A value Thanks... Viewstate will do the favour of that , try this (CODE) Go to Solution 4 2 2 Participants Rajar Ahmed(4 comments) LVL 18 ASP.NET16 MS Excel1 forsters(2 comments) 6 Comments Now, one of the columns has some markup content to be added in the header.

Privacy Statement| Terms of Use| Contact Us| Advertise With Us| CMS by Umbraco| Hosted on Microsoft Azure Feedback on ASP.NET| File Bugs| Support Lifecycle current community chat Stack Overflow Meta Stack

Thank you, that's just so valuable to be able to put the pieces together. 0 LVL 18 Overall: Level 18 ASP.NET 16 MS Excel 1 Message Expert Comment by:Rajar Ahmed2012-07-31 Reply devensawant Contributor 2131 Points 866 Posts Re: Gridview: AllowSorting/SortExpression not working with TemplateField Jun 21, 2011 10:41 AM|devensawant|LINK Try adding SortParameterName="sortExpression" to your object datasource Deven, India(Mumbai) | My Blog Rate this: Please Sign up or sign in to vote. Browse other questions tagged c# asp.net sorting gridview ado.net or ask your own question.

int sortColumnIndex = GetSortColumnIndex(); if (sortColumnIndex != -1) { // Call the AddSortImage helper method to add // a sort direction image to the appropriate // column header. Connect with top rated Experts 14 Experts available now in Live! The problem is, SortExpression does not work if there is a tag in a , you have to put it inside the HeaderText property of . http://philgiebler.com/not-working/sorting-on-gridview-not-working.html Learning resources Microsoft Virtual Academy Channel 9 MSDN Magazine Community Forums Blogs Codeplex Support Self support Programs BizSpark (for startups) Microsoft Imagine (for students) United States (English) Newsletter Privacy & cookies

Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI The DataSourceMode is set to DataSet for the SQLDataSource.

© Copyright 2017 philgiebler.com. All rights reserved.