Need to get the Range...

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

5 Replies

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

///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


SC Sathish Chandran 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.


SC Sathish Chandran August 24, 2006 02:08 PM UTC

Hi Haneef,

I got the solution. Thanks.

Thanks & Regards,
Sathish.


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


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

Loader.
Up arrow icon