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.

Need to get the Range...

Thread ID:

Created:

Updated:

Platform:

Replies:

48309 Aug 24,2006 06:43 AM Aug 25,2006 05:43 AM Windows Forms 5
loading
Tags: GridControl
Sathish Chandran
Asked On August 24, 2006 06:43 AM

Hi,
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,
Sathish.

GridHeader0.zip

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

Hi Sathish,

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

///DropDownFormCellRenderer
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,
Haneef

Sathish Chandran
Replied On August 24, 2006 09:59 AM

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.

Sathish Chandran
Replied On August 24, 2006 10:08 AM

Hi Haneef,

I got the solution. Thanks.

Thanks & Regards,
Sathish.

Sathish Chandran
Replied On August 24, 2006 12:13 PM

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,
Sathish.

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

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);
this.Grid.ViewLayout.ScrollAreaBounds

//For Visible cellRange..
this.Grid.ViewLayout.VisibleCellsRange

//No fo visbile columns
this.Grid.ViewLayout.VisibleCols

Thanks for using Syncfusion Products.
Regards,
Rajagopal

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.

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.

;