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. Image for the cookie policy date

selected range issue

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

1 Reply

AD Administrator Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon