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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

selected range issue

Thread ID:

Created:

Updated:

Platform:

Replies:

46311 Jul 10,2006 10:06 PM UTC Jul 10,2006 11:08 PM UTC WinForms 1
loading
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

CONFIRMATION

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.

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

;