We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to click on columnheader, and sorting in datagrid ?

Thread ID:





36375 Oct 28,2005 07:23 AM UTC Dec 16,2005 12:59 PM UTC WinForms 3
Tags: FAQ
Administrator [Syncfusion]
Asked On October 28, 2005 07:23 AM UTC

Hi. Nice site :) As the topic says. When i click on a colum header, i want to sort the data in the datagrid.. The datagrid is using an arraylist as source.. So question 1: How do I "catch" the click on certain column header question 2: How do I sort the data when clicking on the column header. Thank you,

Anupama Roy [Syncfusion]
Replied On November 2, 2005 07:48 AM UTC

Hi Lasse, Do you have many columns in your ArrayList? You can write code on the DataGrid''s MouseDown event to catch the click on Colum header. And for sorting the data,save your data in arrary list and bind your dataview and set the Sort property of DataView .After that call DataGrid''s Refresh method. If you are populating from a database,you can use the SQL statement Select...from...OrderBy ,but you need to load data from database every time you want to sort the data, which makes application slower. Regards, Anu.

Administrator [Syncfusion]
Replied On December 16, 2005 12:54 PM UTC

Hi How do i know which coloumn is selected in the mousedown event? thanks in advance

Administrator [Syncfusion]
Replied On December 16, 2005 12:59 PM UTC

Hai I think thr is no need of any code.Just keep the AllowSorting=true. Am i right?


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon