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

Need to get the Range...

Thread ID:





48309 Aug 24,2006 10:43 AM UTC Aug 25,2006 09:43 AM UTC WinForms 5
Tags: GridControl
Sathish Chandran
Asked On August 24, 2006 10:43 AM UTC

I''ve custom combo control. When I click the combo I''ll be getting a message box. I want to know the top,left,bottom,right of that particular combo cell, which has been clicked.

I''ve attached a sample.

Please help me out.

Thanks & Regard,


Administrator [Syncfusion]
Replied On August 24, 2006 11:42 AM UTC

Hi Sathish,

To get the CellLayoutRange, you can use the Renderer.GetCellClientRectangle method. Below is a code snippet

protected override void OnButtonClicked(int rowIndex, int colIndex, int button)
Rectangle rect = this.GetCellClientRectangle(rowIndex,colIndex,this.Grid.Model[rowIndex,colIndex],false );
GridRangeInfo info = GridRangeInfo.Cell(rowIndex,colIndex);

string CellLayoutRange = string.Format( "CellLayout Range:[Top = {0},Left = {1},Bottom = {2},Right={3}]",rect.Top,rect.Left,rect.Bottom,rect.Right);
string CellRange = string.Format( "GridCellRange:[Top = {0},Left = {1},Bottom = {2},Right={3}]",info.Top,info.Left,info.Bottom,info.Right);

MessageBox.Show(CellLayoutRange + Environment.NewLine + CellRange , "Grid Filters :" );

Let me know if this helps.
Best Regards,

Sathish Chandran
Replied On August 24, 2006 01:59 PM UTC

Hi Haneef,

It works fine. I want to capture the cursor location when I click the custom control which I send you earlier.

Based on the bottom and left I could able to get the X position but I need the Y position. My form is an embedded inside a mainform. So based on the cursor click location I could able to get the Y position.

Please help me out.

Thanks & Regards,

Sathish Chandran
Replied On August 24, 2006 02:08 PM UTC

Hi Haneef,

I got the solution. Thanks.

Thanks & Regards,

Sathish Chandran
Replied On August 24, 2006 04:13 PM UTC

Hi Haneef,

I need one more help in this. In the custom control I also need to know the Grid Layout info.
Grid size will change based on the number of columns.

How can I get it. Please help me out.

Thanks & Regards,

Administrator [Syncfusion]
Replied On August 25, 2006 09:43 AM UTC

Hi Satish,

Use the ViewLayout property of the grid to manage the layout information about the grid such as cell postions, number of visible columns and more. Below is code snippet.

//for visiblearea in the client coordinate ( excluding both column and row headers);

//For Visible cellRange..

//No fo visbile columns

Thanks for using Syncfusion Products.


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