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.
Unfortunately, activation email could not send to your email. Please try again.

selected range issue

Thread ID:





46311 Jul 10,2006 06:06 PM Jul 10,2006 07:08 PM Windows Forms 1
Tags: GridControl
Hui Zhong
Asked On July 10, 2006 06:06 PM

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 07:08 PM

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.

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.