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

selected range issue

Thread ID:





46311 Jul 10,2006 10:06 PM UTC Jul 10,2006 11:08 PM UTC WinForms 1
Tags: GridControl
Hui Zhong
Asked On July 10, 2006 10:06 PM UTC

Right click and select the cells range, how can I get the column number? I need to make those columns frozen. Thanks.

Administrator [Syncfusion]
Replied On July 10, 2006 11:08 PM UTC

Hi Hui, Try this code to get the column number in the selectionchanging event. Here is a code snippet //Form Load event. gridControl1.ExcelLikeCurrentCell = true; gridControl1.Model.SelectionChanging +=new GridSelectionChangingEventHandler(Model_SelectionChanging); //Selection changed event. private void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e) { if( ( e.Reason == GridSelectionReason.MouseDown || e.Reason == GridSelectionReason.SetCurrentCell || e.Reason == GridSelectionReason.MouseMove ) && !e.Range.IsEmpty ) { if( e.ClickRange != null && e.Range != null ) { Console.WriteLine( "[ CURRENT CELL ] Left Column Number :" + e.ClickRange.Left + " ==> " + e.ClickRange.Right ); Console.WriteLine( "[ RANGE COLUMN ] Left Column Number :" + e.Range.Left + " ==> " + e.Range.Right ); } } } Let me know if this helps. Best Regards, Haneef


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

or the page will be automatically redirected to 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